import { ParsedArgs } from 'minimist' ; import { Cli } from '../cli' ; import { SyncCommand } from './types' ; export class HelpCommand extends SyncCommand { private cli : Cli ; public name : string = 'help' ; public description : string = 'shows this help screen' ; constructor ( cli ) { super ( ) ; this . cli = cli ; } run ( args ) { if ( args . _ . length > 0 ) { this . cli . helpTopic ( args . _ [ 0 ] ) ; } else { this . cli . help ( ) ; } } }