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
|
|
|
|
2014-11-18 12:41:13 +00:00
|
|
|
auth = require('./actions/auth')
|
|
|
|
app = require('./actions/app')
|
|
|
|
|
2014-11-17 19:48:26 +00:00
|
|
|
program.version(packageJSON.version)
|
|
|
|
|
|
|
|
program
|
|
|
|
.command('login <username:password>')
|
|
|
|
.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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# TODO: Check if not running on UNIX environment
|
|
|
|
# and add a custom path accordingly
|
|
|
|
data.prefix.set config.dataPrefix, (error) ->
|
|
|
|
throw error if error?
|
|
|
|
program.parse(process.argv)
|