File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed
Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -74,23 +74,22 @@ function main() {
7474 args = cli . args ( ) ;
7575
7676 // Extract the command:
77- cmd = args [ 0 ] ;
78- if ( cmd === 'help' ) {
77+ if ( args [ 0 ] === 'help' ) {
7978 if ( args [ 1 ] === void 0 ) {
8079 return cli . help ( ) ;
8180 }
8281 cmd = COMMANDS [ args [ 1 ] ] ;
8382 if ( cmd === void 0 ) {
84- return onError ( new Error ( 'invalid argument. Unrecognized/unsupported command. Value: `' + cmd + '`.' ) ) ;
83+ return onError ( new Error ( 'invalid argument. Unrecognized/unsupported command. Value: `' + args [ 1 ] + '`.' ) ) ;
8584 }
86- cmd = resolve ( __dirname , '..' , cmd ) ;
85+ cmd = resolve ( __dirname , '..' , cmd . path ) ;
8786 subargs = [ cmd , '--help' ] ;
8887 } else {
89- cmd = COMMANDS [ cmd ] ;
88+ cmd = COMMANDS [ args [ 0 ] ] ;
9089 if ( cmd === void 0 ) {
91- return onError ( new Error ( 'invalid argument. Unrecognized/unsupported command. Value: `' + cmd + '`.' ) ) ;
90+ return onError ( new Error ( 'invalid argument. Unrecognized/unsupported command. Value: `' + args [ 0 ] + '`.' ) ) ;
9291 }
93- cmd = resolve ( __dirname , '..' , cmd ) ;
92+ cmd = resolve ( __dirname , '..' , cmd . path ) ;
9493 subargs = [ cmd ] ;
9594 for ( i = 1 ; i < args . length ; i ++ ) {
9695 subargs . push ( args [ i ] ) ;
Original file line number Diff line number Diff line change 11{
2- "datasets" : " ./lib/node_modules/@stdlib/datasets/bin/cli" ,
3- "ls" : " ./lib/node_modules/@stdlib/_tools/pkgs/names/bin/cli" ,
4- "ls-tree" : " ./lib/node_modules/@stdlib/_tools/pkgs/tree/bin/cli" ,
5- "ns" : " ./lib/node_modules/@stdlib/namespace/bin/cli" ,
6- "repl" : " ./lib/node_modules/@stdlib/repl/bin/cli"
2+ "datasets" : {
3+ "path" : " ./lib/node_modules/@stdlib/datasets/bin/cli"
4+ },
5+ "ls" : {
6+ "path" : " ./lib/node_modules/@stdlib/_tools/pkgs/names/bin/cli"
7+ },
8+ "ls-tree" : {
9+ "path" : " ./lib/node_modules/@stdlib/_tools/pkgs/tree/bin/cli"
10+ },
11+ "ns" : {
12+ "path" : " ./lib/node_modules/@stdlib/namespace/bin/cli"
13+ },
14+ "repl" : {
15+ "path" : " ./lib/node_modules/@stdlib/repl/bin/cli"
16+ }
717}
You can’t perform that action at this time.
0 commit comments