youtube
409 Bytes
#!/usr/bin/env node
var command = (process.argv[2]) ? process.argv[2] : null;
var commands = ['id', 'search', 'related'];
var cli = require('../lib/cli');
/**
* Error
* command is null
*/
if (!command) {
cli.error(0);
process.exit(0);
}
/**
* Error
* command don't exist in applications
*/
if ((commands.indexOf(command) != -1) === false) {
cli.error(1);
process.exit(1);
}
cli[command]();