2014-11-17 15:48:26 -04:00
|
|
|
program = require('commander')
|
2014-11-18 08:35:50 -04:00
|
|
|
packageJSON = require('../package.json')
|
|
|
|
data = require('./data/data')
|
|
|
|
config = require('./config')
|
2014-11-17 15:48:26 -04:00
|
|
|
|
|
|
|
program.version(packageJSON.version)
|
|
|
|
|
2014-11-18 11:37:29 -04:00
|
|
|
# ---------- Auth Module ----------
|
|
|
|
|
2014-11-18 11:40:12 -04:00
|
|
|
auth = require('./actions/auth')
|
|
|
|
|
2014-11-17 15:48:26 -04:00
|
|
|
program
|
2014-11-18 12:15:40 -04:00
|
|
|
.command('login [username:password]')
|
2014-11-17 15:48:26 -04:00
|
|
|
.description('Login with your resin.io account')
|
2014-11-18 08:41:13 -04:00
|
|
|
.action(auth.login)
|
2014-11-17 15:48:26 -04:00
|
|
|
|
2014-11-18 11:48:05 -04:00
|
|
|
program
|
|
|
|
.command('logout')
|
|
|
|
.description('Logout from your resin.io account')
|
|
|
|
.action(auth.logout)
|
|
|
|
|
2014-11-18 11:37:29 -04:00
|
|
|
program
|
|
|
|
.command('signup')
|
|
|
|
.description('Open signup form')
|
|
|
|
.action(auth.signup)
|
|
|
|
|
|
|
|
# ---------- App Module ----------
|
|
|
|
|
2014-11-18 11:40:12 -04:00
|
|
|
app = require('./actions/app')
|
|
|
|
|
2014-11-17 15:48:26 -04:00
|
|
|
program
|
|
|
|
.command('apps')
|
|
|
|
.description('Show a list of your apps')
|
2014-11-18 08:41:13 -04:00
|
|
|
.action(app.list)
|
2014-11-17 15:48:26 -04:00
|
|
|
|
2014-11-19 09:23:40 -04:00
|
|
|
program
|
|
|
|
.command('app <id>')
|
|
|
|
.description('Show an application')
|
|
|
|
.action(app.info)
|
|
|
|
|
2014-11-19 08:59:17 -04:00
|
|
|
# ---------- Preferences Module ----------
|
|
|
|
|
|
|
|
preferences = require('./actions/preferences')
|
|
|
|
|
|
|
|
program
|
|
|
|
.command('preferences')
|
|
|
|
.description('Open preferences in your web browser')
|
|
|
|
.action(preferences.preferences)
|
|
|
|
|
2014-11-17 15:48:26 -04:00
|
|
|
data.prefix.set config.dataPrefix, (error) ->
|
|
|
|
throw error if error?
|
|
|
|
program.parse(process.argv)
|