mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-12-19 11:32:18 -06:00
feat: cli v0.2.0
This commit is contained in:
29
lib/cli.js
Normal file
29
lib/cli.js
Normal file
@@ -0,0 +1,29 @@
|
||||
var argv = require('optimist').argv
|
||||
|
||||
|
||||
const operations = {
|
||||
// 'create': require('./create'),
|
||||
'help': require('./help'),
|
||||
'server': require('./server'),
|
||||
'pm2': require('./pm2'),
|
||||
}
|
||||
|
||||
|
||||
function main() {
|
||||
try{
|
||||
|
||||
var operation = argv._[0]
|
||||
if (!operation) operation = 'help'
|
||||
if (!operations[operation]) {
|
||||
console.error('Unknown operation: ' + operation)
|
||||
operation = 'help'
|
||||
}
|
||||
operations[operation](argv)
|
||||
} catch (e) {
|
||||
console.error(e.message || e)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user