-
Notifications
You must be signed in to change notification settings - Fork 0
/
sg-cli
executable file
·31 lines (26 loc) · 929 Bytes
/
sg-cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/node
const CMDjs = require('./es6');
const { log } = console;
const characters = {
good: [ 'Okabe Rintaro', 'Shiina Mayuri', 'Hashida Itaru', 'Makise Kurisu' ],
evil: [ 'Kiryu Moeka', 'Yugo Tennouji' ]
}
const cmd = new CMDjs({
'-h, --help': _ => log(
'Usage:\n list\n List of Steins;Gate characters'
+ '\n -a, --all All characters'
+ '\n -g --good Good guys'
+ '\n -e --evil Bad guys'),
'ls, list': {
'-a, --all': _ => log([ ...characters.good, ...characters.evil ].join('\n')),
'-g, --good': _ => log(characters.good.join('\n')),
'-e, --evil, -b, --bad': _ => log(characters.evil.join('\n')),
'@default': _ => log(
' -a, --all All characters'
+ '\n -g --good Good guys'
+ '\n -e --evil Bad guys')
},
'@default': _ => log('Use --help to get help text'),
});
cmd.use({ 'password': _ => log('El psy kongroo.') }); // Add more commands!
cmd.start(process);