forked from mirrors/probot
feat: warn on passing in unknown commands
This commit is contained in:
parent
5b86e1bb6a
commit
f368013729
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const semver = require('semver')
|
||||
const program = require('commander')
|
||||
const version = require('../package').engines.node
|
||||
|
||||
if (!semver.satisfies(process.version, version)) {
|
||||
|
@ -8,9 +9,16 @@ if (!semver.satisfies(process.version, version)) {
|
|||
process.exit(1)
|
||||
}
|
||||
|
||||
require('commander')
|
||||
program
|
||||
.version(require('../package').version)
|
||||
.usage('<command> [options]')
|
||||
.command('run', 'run the bot')
|
||||
.command('receive', 'Receive a single event and payload')
|
||||
|
||||
program.on('command:*', (cmd) => {
|
||||
console.log(`\nInvalid command ${cmd}\n`)
|
||||
program.outputHelp()
|
||||
})
|
||||
|
||||
program
|
||||
.parse(process.argv)
|
||||
|
|
Loading…
Reference in New Issue