File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 1616 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1717 * PERFORMANCE OF THIS SOFTWARE.
1818 */
19- import * as yargs from 'yargs' ;
19+ import yargs from 'yargs'
20+ import { hideBin } from 'yargs/helpers'
21+
2022import { VERSION , checkForUpdate } from './lib' ;
2123
2224( async ( ) => {
25+ const y = yargs ( hideBin ( process . argv ) ) ;
26+
2327 await checkForUpdate ( ) ;
2428
25- const argv : any = await yargs
26- . usage ( 'IMQ Command Line Interface' +
29+ await y . usage ( 'IMQ Command Line Interface' +
2730 `\nVersion: ${ VERSION } ` +
2831 '\n\nUsage: $0 <command>' )
2932 . version ( VERSION )
3033 . commandDir ( 'src' )
3134 . demandCommand ( )
32- . wrap ( yargs . terminalWidth ( ) )
35+ . wrap ( y . terminalWidth ( ) )
3336 . help ( )
3437 . argv
3538 ;
36-
37- const commands = ( yargs as any ) . getCommandInstance ( ) . getCommands ( ) ;
38-
39- if ( commands . length && ! (
40- argv . _ [ 0 ] && ~ commands . indexOf ( argv . _ [ 0 ] )
41- ) ) {
42- yargs . showHelp ( ) ;
43- process . exit ( 1 ) ;
44- }
4539} ) ( ) ;
You can’t perform that action at this time.
0 commit comments