diff --git a/src/help/index.ts b/src/help/index.ts index 386b39a51..b667bc0a9 100644 --- a/src/help/index.ts +++ b/src/help/index.ts @@ -20,12 +20,6 @@ const { const ROOT_INDEX_CMD_ID = '' -export interface HelpOptions { - all?: boolean; - maxWidth: number; - stripAnsi?: boolean; -} - function getHelpSubject(args: string[]): string | undefined { for (const arg of args) { if (arg === '--') return @@ -36,14 +30,14 @@ function getHelpSubject(args: string[]): string | undefined { } export abstract class HelpBase { - constructor(config: Interfaces.Config, opts: Partial = {}) { + constructor(config: Interfaces.Config, opts: Partial = {}) { this.config = config this.opts = {maxWidth: stdtermwidth, ...opts} } protected config: Interfaces.Config - protected opts: HelpOptions + protected opts: Interfaces.HelpOptions /** * Show help, used in multi-command CLIs @@ -95,7 +89,7 @@ export class Help extends HelpBase { return topics } - constructor(config: Interfaces.Config, opts: Partial = {}) { + constructor(config: Interfaces.Config, opts: Partial = {}) { super(config, opts) this.render = template(this) } diff --git a/src/interfaces/help.ts b/src/interfaces/help.ts new file mode 100644 index 000000000..07cc5d161 --- /dev/null +++ b/src/interfaces/help.ts @@ -0,0 +1,5 @@ +export interface HelpOptions { + all?: boolean; + maxWidth: number; + stripAnsi?: boolean; +} diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index 1aebac214..c9e3bf49f 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -1,5 +1,6 @@ export {Config, ArchTypes, PlatformTypes, LoadOptions} from './config' export {Command} from './command' +export {HelpOptions} from './help' export {Hook, HookKeyOrOptions, Hooks} from './hooks' export {Manifest} from './manifest' export {PJSON} from './pjson'