mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-05 13:34:08 +00:00
Make the CommandDefinition option parameter a Partial
This ensures that no code accidentally relies on them being present, and the types are then correct. Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
b391c96e64
commit
5da307f02e
@ -29,6 +29,9 @@ function renderCapitanoCommand(command: CapitanoCommand): string[] {
|
|||||||
result.push('### Options');
|
result.push('### Options');
|
||||||
|
|
||||||
for (const option of command.options!) {
|
for (const option of command.options!) {
|
||||||
|
if (option == null) {
|
||||||
|
throw new Error(`Undefined option in markdown generation!`);
|
||||||
|
}
|
||||||
result.push(
|
result.push(
|
||||||
`#### ${utils.parseCapitanoOption(option)}`,
|
`#### ${utils.parseCapitanoOption(option)}`,
|
||||||
option.description,
|
option.description,
|
||||||
|
@ -138,7 +138,7 @@ export const remove: CommandDefinition<
|
|||||||
|
|
||||||
return patterns
|
return patterns
|
||||||
.confirm(
|
.confirm(
|
||||||
options.yes,
|
options.yes || false,
|
||||||
'Are you sure you want to delete the environment variable?',
|
'Are you sure you want to delete the environment variable?',
|
||||||
)
|
)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
4
typings/capitano/index.d.ts
vendored
4
typings/capitano/index.d.ts
vendored
@ -36,11 +36,11 @@ declare module 'capitano' {
|
|||||||
signature: string;
|
signature: string;
|
||||||
description: string;
|
description: string;
|
||||||
help: string;
|
help: string;
|
||||||
options?: OptionDefinition[];
|
options?: Partial<OptionDefinition[]>;
|
||||||
permission?: 'user';
|
permission?: 'user';
|
||||||
root?: boolean;
|
root?: boolean;
|
||||||
primary?: boolean;
|
primary?: boolean;
|
||||||
action(params: P, options: O, done: () => void): void;
|
action(params: P, options: Partial<O>, done: () => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Command {
|
export interface Command {
|
||||||
|
Loading…
Reference in New Issue
Block a user