-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
81 lines (69 loc) · 1.56 KB
/
cli.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const open = require('opn');
const web = 'https://shellhacks.net';
const wtp = 'https://shellhacks-2018.devpost.com/';
const github = 'https://github.com/ShellHacksFIU';
const discord = 'https://discordapp.com/invite/upefiu';
const badges = 'https://github.com/abranhe/shellhacks';
const cli = meow(`
Usage:
$ shellhacks [options|flags...]
Options:
web Opens ShellHack website
wtp Where to post your projects (devpost)
badges View how to add a Shellhacks badge
github Opens ShellHack Github Account
discord Opens UPEFIU discord server
Flags:
-f, --feedback Send a feedback
-h, --help Show help message and close
-v, --version View package Version
Example
$ shellhacks --feedback
Join the Discord server app for support!
$ shellhacks web
`,{
flags: {
help: {
type: 'boolean',
alias: 'h'
},
version: {
type: 'boolean',
alias: 'v'
},
feedback: {
type: 'boolean',
alias: 'f'
}
}
});
if(!cli.input.length == 1 || cli.input.length > 1) {
cli.showHelp();
}
if(cli.flags.feedback) {
console.log('Join the Discord server app for support!\n');
cli.showHelp();
}
if(cli.input[0] === 'badges') {
open(badges);
process.exit();
}
if(cli.input[0] === 'wtp') {
open(wtp);
process.exit();
}
if(cli.input[0] === 'discord') {
open(discord);
process.exit();
}
if(cli.input[0] === 'web') {
open(web);
process.exit();
}
if(cli.input[0] === 'github') {
open(github);
process.exit();
}