balena-cli/lib/app.coffee

42 lines
1.2 KiB
CoffeeScript
Raw Normal View History

2014-11-18 12:35:50 +00:00
data = require('./data/data')
config = require('./config')
2014-11-17 19:48:26 +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 ----------
auth = require('./actions/auth')
# 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 ----------
app = require('./actions/app')
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')
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')
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?
yargs.command.run()