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