Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/design/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ Note: There's a limit of 20 custom dimensions.
| 6 | `--collection` | `string` |
| 7 | `Flag: --strict` | `boolean` |
| 8 | `Ivy Enabled` | `boolean` |
| 9 | `Flag: --inlineStyle` | `boolean` |
| 10 | `Flag: --inlineTemplate` | `boolean` |
| 11 | `Flag: --viewEncapsulation` | `string` |
| 12 | `Flag: --skipTests` | `boolean` |
| 9 | `Flag: --inline-style` | `boolean` |
| 10 | `Flag: --inline-template` | `boolean` |
| 11 | `Flag: --view-encapsulation` | `string` |
| 12 | `Flag: --skip-tests` | `boolean` |
| 13 | `Flag: --aot` | `boolean` |
| 14 | `Flag: --minimal` | `boolean` |
| 15 | `Flag: --lintFix` | `boolean` |
| 15 | `Flag: --lint-fix` | `boolean` |
| 16 | `Flag: --optimization` | `boolean` |
| 17 | `Flag: --routing` | `boolean` |
| 18 | `Flag: --skipImport` | `boolean` |
| 18 | `Flag: --skip-import` | `boolean` |
| 19 | `Flag: --export` | `boolean` |
| 20 | `Build Errors (comma separated)` | `string` |
<!--DIMENSIONS_TABLE_END-->
Expand Down
5 changes: 4 additions & 1 deletion packages/angular/cli/models/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
}

async printJsonHelp(_options: T & Arguments): Promise<number> {
this.logger.info(JSON.stringify(this.description));
const replacer = (key: string, value: string) => key === 'name'
? strings.dasherize(value)
: value;
this.logger.info(JSON.stringify(this.description, replacer, 2));

return 0;
}
Expand Down
6 changes: 5 additions & 1 deletion tests/legacy-cli/e2e/tests/commands/help/help-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export default async function() {
const { stdout } = await silentNg(commandName, '--help=json');

if (stdout.trim()) {
JSON.parse(stdout);
JSON.parse(stdout, (key, value) => {
if (key === 'name' && /[A-Z]/.test(value)) {
throw new Error(`Option named '${value}' is not kebab case.`);
}
});
} else {
console.warn(`No JSON output for command [${commandName}].`);
}
Expand Down