-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·64 lines (56 loc) · 1.06 KB
/
cli.js
File metadata and controls
executable file
·64 lines (56 loc) · 1.06 KB
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
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const boxen = require('boxen');
const oclock = require('o-clock');
const feedback = require('@abranhe/feedback');
const cli = meow(
`
Usage
$ wtii
╭───────╮
│3:07 PM│
╰───────╯
Options
-f, --feedback Send a feedback
-h, --help Show help message and close
-v, --version View package Version
Examples
$ what-time-is-it
╭───────╮
│7:03 PM│
╰───────╯
`,
{
flags: {
help: {
type: 'boolean',
alias: 'h'
},
version: {
type: 'boolean',
alias: 'v'
},
feedback: {
type: 'boolean',
alias: 'f'
}
}
},
);
console.log(
boxen(oclock(), {
borderColor: 'cyan',
float: 'left',
borderStyle: 'round',
pading: 3,
margin: 1
}),
);
if (cli.flags.feedback) {
feedback.project('wtii');
feedback.description('Are you getting the wrong time? Open an issue at:');
feedback.link(cli.pkg.bugs.url);
feedback.message(feedback.defaultMessage);
feedback.web();
}