Skip to content

Commit

Permalink
cli: add implies to cli options
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 22, 2024
1 parent d49bf40 commit 3eff97c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cli/jhipster-command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ export default class JHipsterCommand extends Command {
if (optionDefinition.choices && optionDefinition.choices.length > 0) {
option.choices(optionDefinition.choices);
}
if (optionDefinition.implies) {
option.implies(optionDefinition.implies);
}
return this.addOption(option);
}
}
11 changes: 9 additions & 2 deletions lib/command/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ export type PromptSpec = {

type JHipsterArgumentConfig = SetOptional<ArgumentSpec, 'name'> & { scope?: CommandConfigScope };

type CliSpec = SetOptional<CliOptionSpec, 'name'> & {
env?: string;
/**
* Imply other options.
*/
implies?: Record<string, any>;
};

export type ConfigSpec<ConfigContext> = {
readonly description?: string;
readonly choices?: JHispterChoices;

readonly cli?: SetOptional<CliOptionSpec, 'name'> & { env?: string };
readonly cli?: CliSpec;
readonly argument?: JHipsterArgumentConfig;
readonly prompt?:
| PromptSpec
Expand Down

0 comments on commit 3eff97c

Please sign in to comment.