File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 49
49
* [ ` cdt autocomplete [SHELL] ` ] ( #cdt-autocomplete-shell )
50
50
* [ ` cdt bundlephobia [PACKAGE] ` ] ( #cdt-bundlephobia-package )
51
51
* [ ` cdt crypto [STRING] ` ] ( #cdt-crypto-string )
52
+ * [ ` cdt date [FILE] ` ] ( #cdt-date-file )
52
53
* [ ` cdt hash [STRING] ` ] ( #cdt-hash-string )
53
54
* [ ` cdt help [COMMAND] ` ] ( #cdt-help-command )
54
55
* [ ` cdt minify [FILE] ` ] ( #cdt-minify-file )
@@ -112,6 +113,22 @@ OPTIONS
112
113
113
114
_ See code: [ src/commands/crypto.ts] ( https://github.com/codingtools/cdt/blob/v0.1.4/src/commands/crypto.ts ) _
114
115
116
+ ## ` cdt date [FILE] `
117
+
118
+ describe the command here
119
+
120
+ ```
121
+ USAGE
122
+ $ cdt date [FILE]
123
+
124
+ OPTIONS
125
+ -f, --force
126
+ -h, --help show CLI help
127
+ -n, --name=name name to print
128
+ ```
129
+
130
+ _ See code: [ src/commands/date.ts] ( https://github.com/codingtools/cdt/blob/v0.1.4/src/commands/date.ts ) _
131
+
115
132
## ` cdt hash [STRING] `
116
133
117
134
Hashing functionality for a string/file
Original file line number Diff line number Diff line change 23
23
"crypto-js" : " ^3.1.9-1" ,
24
24
"jshashes" : " ^1.0.7" ,
25
25
"minify" : " ^4.1.3" ,
26
+ "moment" : " ^2.24.0" ,
26
27
"nyc" : " ^14.1.1" ,
27
28
"ora" : " ^4.0.2" ,
28
29
"signale" : " ^1.4.0" ,
Original file line number Diff line number Diff line change
1
+ import { Command , flags } from '@oclif/command'
2
+
3
+ export default class Date extends Command {
4
+ static description = 'describe the command here'
5
+
6
+ static flags = {
7
+ help : flags . help ( { char : 'h' } ) ,
8
+ // flag with a value (-n, --name=VALUE)
9
+ name : flags . string ( { char : 'n' , description : 'name to print' } ) ,
10
+ // flag with no value (-f, --force)
11
+ force : flags . boolean ( { char : 'f' } ) ,
12
+ }
13
+
14
+ static args = [ { name : 'file' } ]
15
+
16
+ async run ( ) {
17
+ const { args, flags} = this . parse ( Date )
18
+
19
+ const name = flags . name || 'world'
20
+ this . log ( `hello ${ name } from /Users/ashish/Desktop/cdt/src/commands/date.ts` )
21
+ if ( args . file && flags . force ) {
22
+ this . log ( `you input --force and --file: ${ args . file } ` )
23
+ }
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@oclif/test'
2
+
3
+ describe ( 'date' , ( ) => {
4
+ test
5
+ . stdout ( )
6
+ . command ( [ 'date' ] )
7
+ . it ( 'runs hello' , ctx => {
8
+ expect ( ctx . stdout ) . to . contain ( 'hello world' )
9
+ } )
10
+
11
+ test
12
+ . stdout ( )
13
+ . command ( [ 'date' , '--name' , 'jeff' ] )
14
+ . it ( 'runs hello --name jeff' , ctx => {
15
+ expect ( ctx . stdout ) . to . contain ( 'hello jeff' )
16
+ } )
17
+ } )
You can’t perform that action at this time.
0 commit comments