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

Commit 39effe2

Browse files
committed
fix: added extra help properties
1 parent e8a4e31 commit 39effe2

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

src/command.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {IConfig} from './config'
2+
import {IPlugin} from './plugin'
23

34
export interface ICachedCommand {
45
_base: string
@@ -9,15 +10,49 @@ export interface ICachedCommand {
910
usage?: string
1011
pluginName?: string
1112
help?: string
13+
flags: {[name: string]: ICachedFlag}
14+
args: ICachedArg[]
1215
load(): Promise<ICommand>
1316
}
1417

18+
export interface IConvertToCachedOptions {
19+
id?: string
20+
plugin?: IPlugin
21+
}
22+
1523
export interface ICommand extends ICachedCommand {
1624
run(argv: string[], opts?: ICommandOptions): Promise<void>
17-
convertToCached(): ICachedCommand
25+
convertToCached(opts?: IConvertToCachedOptions): ICachedCommand
1826
}
1927

2028
export interface ICommandOptions {
2129
root?: string
2230
config?: IConfig
2331
}
32+
33+
export interface ICachedArg {
34+
name: string
35+
description?: string
36+
required?: boolean
37+
hidden?: boolean
38+
}
39+
40+
export interface ICachedBooleanFlag {
41+
type: 'boolean'
42+
name: string
43+
required?: boolean
44+
char?: string
45+
hidden?: boolean
46+
description?: string
47+
}
48+
49+
export interface ICachedOptionFlag {
50+
type: 'option'
51+
name: string
52+
required?: boolean
53+
char?: string
54+
hidden?: boolean
55+
description?: string
56+
}
57+
58+
export type ICachedFlag = ICachedBooleanFlag | ICachedOptionFlag

0 commit comments

Comments
 (0)