mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +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');
|
||||
|
||||
for (const option of command.options!) {
|
||||
if (option == null) {
|
||||
throw new Error(`Undefined option in markdown generation!`);
|
||||
}
|
||||
result.push(
|
||||
`#### ${utils.parseCapitanoOption(option)}`,
|
||||
option.description,
|
||||
|
@ -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() {
|
||||
|
4
typings/capitano/index.d.ts
vendored
4
typings/capitano/index.d.ts
vendored
@ -36,11 +36,11 @@ declare module 'capitano' {
|
||||
signature: string;
|
||||
description: string;
|
||||
help: string;
|
||||
options?: OptionDefinition[];
|
||||
options?: Partial<OptionDefinition[]>;
|
||||
permission?: 'user';
|
||||
root?: boolean;
|
||||
primary?: boolean;
|
||||
action(params: P, options: O, done: () => void): void;
|
||||
action(params: P, options: Partial<O>, done: () => void): void;
|
||||
}
|
||||
|
||||
export interface Command {
|
||||
|
Loading…
Reference in New Issue
Block a user