diff --git a/automation/capitanodoc/markdown.ts b/automation/capitanodoc/markdown.ts index 808e309d..974d7b09 100644 --- a/automation/capitanodoc/markdown.ts +++ b/automation/capitanodoc/markdown.ts @@ -29,6 +29,9 @@ function renderCapitanoCommand(command: CapitanoCommand): string[] { result.push('### Options'); for (const option of command.options!) { + if (option == null) { + throw new Error(`Undefined option in markdown generation!`); + } result.push( `#### ${utils.parseCapitanoOption(option)}`, option.description, diff --git a/lib/actions/environment-variables.ts b/lib/actions/environment-variables.ts index 5254e2ed..7ae16cd1 100644 --- a/lib/actions/environment-variables.ts +++ b/lib/actions/environment-variables.ts @@ -138,7 +138,7 @@ export const remove: CommandDefinition< return patterns .confirm( - options.yes, + options.yes || false, 'Are you sure you want to delete the environment variable?', ) .then(function() { diff --git a/typings/capitano/index.d.ts b/typings/capitano/index.d.ts index a2d65b44..2ce5efef 100644 --- a/typings/capitano/index.d.ts +++ b/typings/capitano/index.d.ts @@ -36,11 +36,11 @@ declare module 'capitano' { signature: string; description: string; help: string; - options?: OptionDefinition[]; + options?: Partial; permission?: 'user'; root?: boolean; primary?: boolean; - action(params: P, options: O, done: () => void): void; + action(params: P, options: Partial, done: () => void): void; } export interface Command {