mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 13:53:22 +02:00
Ported CLI from commander to yargs because yargs suits our large CLI better and is easier to develop with. Split commands into separate files since the file was getting annoyingly long.
This commit is contained in:
40
lib/cli/index.js
Normal file
40
lib/cli/index.js
Normal file
@@ -0,0 +1,40 @@
|
||||
var yargs = require('yargs')
|
||||
var Promise = require('bluebird')
|
||||
|
||||
Promise.longStackTraces()
|
||||
|
||||
var _argv = yargs.usage('Usage: $0 <command> [options]')
|
||||
.strict()
|
||||
.command(require('./api'))
|
||||
.command(require('./app'))
|
||||
.command(require('./auth-ldap'))
|
||||
.command(require('./auth-mock'))
|
||||
.command(require('./auth-oauth2'))
|
||||
.command(require('./auth-openid'))
|
||||
.command(require('./auth-saml2'))
|
||||
.command(require('./device'))
|
||||
.command(require('./doctor'))
|
||||
.command(require('./generate-fake-device'))
|
||||
.command(require('./local'))
|
||||
.command(require('./log-rethinkdb'))
|
||||
.command(require('./migrate'))
|
||||
.command(require('./notify-hipchat'))
|
||||
.command(require('./notify-slack'))
|
||||
.command(require('./poorxy'))
|
||||
.command(require('./processor'))
|
||||
.command(require('./provider'))
|
||||
.command(require('./reaper'))
|
||||
.command(require('./storage-plugin-apk'))
|
||||
.command(require('./storage-plugin-image'))
|
||||
.command(require('./storage-s3'))
|
||||
.command(require('./storage-temp'))
|
||||
.command(require('./triproxy'))
|
||||
.command(require('./websocket'))
|
||||
.demand(1, 'Must provide a valid command.')
|
||||
.help('h', 'Show help.')
|
||||
.alias('h', 'help')
|
||||
.version('V', 'Show version.', function() {
|
||||
return require('../../package').version
|
||||
})
|
||||
.alias('V', 'version')
|
||||
.argv
|
||||
Reference in New Issue
Block a user