Skip to content

Commit

Permalink
feat: export HelpOptions in Interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Sep 16, 2020
1 parent 10d3de9 commit 4351759
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/help/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,14 +30,14 @@ function getHelpSubject(args: string[]): string | undefined {
}

export abstract class HelpBase {
constructor(config: Interfaces.Config, opts: Partial<HelpOptions> = {}) {
constructor(config: Interfaces.Config, opts: Partial<Interfaces.HelpOptions> = {}) {
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
Expand Down Expand Up @@ -95,7 +89,7 @@ export class Help extends HelpBase {
return topics
}

constructor(config: Interfaces.Config, opts: Partial<HelpOptions> = {}) {
constructor(config: Interfaces.Config, opts: Partial<Interfaces.HelpOptions> = {}) {
super(config, opts)
this.render = template(this)
}
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces/help.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface HelpOptions {
all?: boolean;
maxWidth: number;
stripAnsi?: boolean;
}
1 change: 1 addition & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 4351759

Please sign in to comment.