2014-11-18 12:35:50 +00:00
|
|
|
data = require('./data/data')
|
|
|
|
config = require('./config')
|
2014-11-17 19:48:26 +00:00
|
|
|
|
2014-11-20 15:57:53 +00:00
|
|
|
yargs = require('yargs')
|
|
|
|
yargs.command = require('./yargs-command/yargs-command')
|
2014-11-17 19:48:26 +00:00
|
|
|
|
2014-11-20 16:05:50 +00:00
|
|
|
yargs.usage('$0 [options] <command>')
|
|
|
|
|
2014-11-18 15:37:29 +00:00
|
|
|
# ---------- Auth Module ----------
|
2014-11-18 15:40:12 +00:00
|
|
|
auth = require('./actions/auth')
|
|
|
|
|
2014-11-20 15:57:53 +00:00
|
|
|
# TODO: Re enable optional interactivity
|
|
|
|
yargs.command('login [username:password]', auth.login)
|
|
|
|
yargs.command('logout', auth.logout)
|
|
|
|
yargs.command('signup', auth.signup)
|
2014-11-18 15:37:29 +00:00
|
|
|
|
|
|
|
# ---------- App Module ----------
|
2014-11-18 15:40:12 +00:00
|
|
|
app = require('./actions/app')
|
2014-11-20 15:57:53 +00:00
|
|
|
yargs.command('apps', app.list)
|
|
|
|
yargs.command('app <id>', app.info)
|
2014-11-20 16:24:39 +00:00
|
|
|
yargs.command('app restart <id>', app.restart)
|
2014-11-19 13:23:40 +00:00
|
|
|
|
2014-11-19 17:38:15 +00:00
|
|
|
# ---------- Device Module ----------
|
|
|
|
device = require('./actions/device')
|
2014-11-20 15:57:53 +00:00
|
|
|
yargs.command('devices <id>', device.list)
|
2014-11-19 17:38:15 +00:00
|
|
|
|
2014-11-19 12:59:17 +00:00
|
|
|
# ---------- Preferences Module ----------
|
|
|
|
preferences = require('./actions/preferences')
|
2014-11-20 15:57:53 +00:00
|
|
|
yargs.command('preferences', preferences.preferences)
|
2014-11-19 12:59:17 +00:00
|
|
|
|
2014-11-20 16:13:59 +00:00
|
|
|
# ---------- Version Module ----------
|
|
|
|
version = require('./actions/version')
|
|
|
|
yargs.command('version', version.version)
|
|
|
|
|
2014-11-20 17:02:29 +00:00
|
|
|
# ---------- Keys Module ----------
|
|
|
|
keys = require('./actions/keys')
|
|
|
|
yargs.command('keys', keys.list)
|
|
|
|
|
2014-11-17 19:48:26 +00:00
|
|
|
data.prefix.set config.dataPrefix, (error) ->
|
|
|
|
throw error if error?
|
2014-11-20 15:57:53 +00:00
|
|
|
yargs.command.run()
|