Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: added extra help properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent e8a4e31 commit 39effe2
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {IConfig} from './config'
import {IPlugin} from './plugin'

export interface ICachedCommand {
_base: string
Expand All @@ -9,15 +10,49 @@ export interface ICachedCommand {
usage?: string
pluginName?: string
help?: string
flags: {[name: string]: ICachedFlag}
args: ICachedArg[]
load(): Promise<ICommand>
}

export interface IConvertToCachedOptions {
id?: string
plugin?: IPlugin
}

export interface ICommand extends ICachedCommand {
run(argv: string[], opts?: ICommandOptions): Promise<void>
convertToCached(): ICachedCommand
convertToCached(opts?: IConvertToCachedOptions): ICachedCommand
}

export interface ICommandOptions {
root?: string
config?: IConfig
}

export interface ICachedArg {
name: string
description?: string
required?: boolean
hidden?: boolean
}

export interface ICachedBooleanFlag {
type: 'boolean'
name: string
required?: boolean
char?: string
hidden?: boolean
description?: string
}

export interface ICachedOptionFlag {
type: 'option'
name: string
required?: boolean
char?: string
hidden?: boolean
description?: string
}

export type ICachedFlag = ICachedBooleanFlag | ICachedOptionFlag

0 comments on commit 39effe2

Please sign in to comment.