Skip to content

Commit af96ccf

Browse files
committed
fix(@angular/cli): fix support for hidden options
They were showing when they should have been hidden.
1 parent d10c9e3 commit af96ccf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/angular/cli/models/schematic-command.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export abstract class SchematicCommand<
108108
schematic.description.schemaJson || {},
109109
);
110110

111-
this.description.options.push(...options);
111+
this.description.options.push(...options.filter(x => !x.hidden));
112112
}
113113
}
114114

packages/angular/cli/utilities/json-schema.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ export async function parseJsonSchemaToOptions(
182182
const aliases = json.isJsonArray(current.aliases) ? [...current.aliases].map(x => '' + x)
183183
: current.alias ? ['' + current.alias] : [];
184184
const format = typeof current.format == 'string' ? current.format : undefined;
185-
const hidden = !!current.hidden;
185+
const visible = current.visible === undefined || current.visible === true;
186+
const hidden = !!current.hidden || !visible;
186187

187188
const option: Option = {
188189
name,

0 commit comments

Comments
 (0)