Skip to content

Commit b4594ba

Browse files
committed
fix(@angular/cli): add more description
1 parent 7ebe4f0 commit b4594ba

File tree

10 files changed

+249
-146
lines changed

10 files changed

+249
-146
lines changed

packages/@angular/cli/commands/build.ts

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,78 +24,81 @@ export const baseBuildCommandOptions: any = [
2424
description: 'Defines the build environment.'
2525
},
2626
{
27-
name: 'output-path',
28-
type: 'Path',
29-
aliases: ['op'],
30-
description: 'Path where output will be placed.'
27+
name: 'output-path',
28+
type: 'Path',
29+
aliases: ['op'],
30+
description: 'Path where output will be placed.'
3131
},
3232
{
33-
name: 'aot',
34-
type: Boolean,
35-
description: 'Build using Ahead of Time compilation.'
33+
name: 'aot',
34+
type: Boolean,
35+
description: 'Build using Ahead of Time compilation.'
3636
},
3737
{
38-
name: 'sourcemap',
39-
type: Boolean,
40-
aliases: ['sm', 'sourcemaps'],
41-
description: 'Output sourcemaps.'
38+
name: 'sourcemap',
39+
type: Boolean,
40+
aliases: ['sm', 'sourcemaps'],
41+
description: 'Output sourcemaps.'
4242
},
4343
{
44-
name: 'vendor-chunk',
45-
type: Boolean,
46-
default: true,
47-
aliases: ['vc'],
48-
description: 'Use a separate bundle containing only vendor libraries.'
44+
name: 'vendor-chunk',
45+
type: Boolean,
46+
default: true,
47+
aliases: ['vc'],
48+
description: 'Use a separate bundle containing only vendor libraries.'
4949
},
5050
{
51-
name: 'base-href',
52-
type: String,
53-
aliases: ['bh'],
54-
description: 'Base url for the application being built.'
51+
name: 'base-href',
52+
type: String,
53+
aliases: ['bh'],
54+
description: 'Base url for the application being built.'
5555
},
5656
{
57-
name: 'deploy-url',
58-
type: String,
59-
aliases: ['d'],
60-
description: 'URL where files will be deployed.'
57+
name: 'deploy-url',
58+
type: String,
59+
aliases: ['d'],
60+
description: 'URL where files will be deployed.'
6161
},
6262
{
63-
name: 'verbose',
64-
type: Boolean,
65-
default: false,
66-
aliases: ['v'],
67-
description: 'Adds more details to output logging.'
63+
name: 'verbose',
64+
type: Boolean,
65+
default: false,
66+
aliases: ['v'],
67+
description: 'Adds more details to output logging.'
6868
},
6969
{
70-
name: 'progress',
71-
type: Boolean,
72-
default: true,
73-
aliases: ['pr'],
74-
description: 'Log progress to the console while building.'
70+
name: 'progress',
71+
type: Boolean,
72+
default: true,
73+
aliases: ['pr'],
74+
description: 'Log progress to the console while building.'
7575
},
7676
{
77-
name: 'i18n-file',
78-
type: String
77+
name: 'i18n-file',
78+
type: String,
79+
description: 'Localization file to use for i18n.'
7980
},
8081
{
81-
name: 'i18n-format',
82-
type: String
82+
name: 'i18n-format',
83+
type: String,
84+
description: 'Format of the localization file specified with --i18n-file.'
8385
},
8486
{
85-
name: 'locale',
86-
type: String
87+
name: 'locale',
88+
type: String,
89+
description: 'Locale to use for i18n.'
8790
},
8891
{
89-
name: 'extract-css',
90-
type: Boolean,
91-
aliases: ['ec'],
92-
description: 'Extract css from global styles onto css files instead of js ones.'
92+
name: 'extract-css',
93+
type: Boolean,
94+
aliases: ['ec'],
95+
description: 'Extract css from global styles onto css files instead of js ones.'
9396
},
9497
{
95-
name: 'watch',
96-
type: Boolean, default: false,
97-
aliases: ['w'],
98-
description: 'Run build when files change.'
98+
name: 'watch',
99+
type: Boolean, default: false,
100+
aliases: ['w'],
101+
description: 'Run build when files change.'
99102
},
100103
{
101104
name: 'output-hashing',

packages/@angular/cli/commands/completion.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface CompletionCommandOptions {
3636
all?: boolean;
3737
bash?: boolean;
3838
zsh?: boolean;
39-
};
39+
}
4040

4141
const commandsToIgnore = [
4242
'destroy',
@@ -51,9 +51,27 @@ const CompletionCommand = Command.extend({
5151
description: 'Adds autocomplete functionality to `ng` commands and subcommands.',
5252
works: 'everywhere',
5353
availableOptions: [
54-
{ name: 'all', type: Boolean, default: true, aliases: ['a'] },
55-
{ name: 'bash', type: Boolean, default: false, aliases: ['b'] },
56-
{ name: 'zsh', type: Boolean, default: false, aliases: ['z'] }
54+
{
55+
name: 'all',
56+
type: Boolean,
57+
default: true,
58+
aliases: ['a'],
59+
description: 'Generate a completion script compatible with both bash and zsh.'
60+
},
61+
{
62+
name: 'bash',
63+
type: Boolean,
64+
default: false,
65+
aliases: ['b']
66+
description: 'Generate a completion script for bash.'
67+
},
68+
{
69+
name: 'zsh',
70+
type: Boolean,
71+
default: false,
72+
aliases: ['z']
73+
description: 'Generate a completion script for zsh.'
74+
}
5775
],
5876

5977
run: function (commandOptions: CompletionCommandOptions) {

packages/@angular/cli/commands/e2e.ts

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,54 +21,63 @@ const E2eCommand = Command.extend({
2121
aliases: ['e'],
2222
description: 'Run e2e tests in existing project.',
2323
works: 'insideProject',
24-
availableOptions: overrideOptions(
25-
baseServeCommandOptions.concat([
26-
{
27-
name: 'config',
28-
type: String,
29-
aliases: ['c'],
30-
description: oneLine`Use a specific config file.
31-
Defaults to the protractor config file in angular-cli.json.`
32-
},
33-
{
34-
name: 'specs',
35-
type: Array,
36-
default: [],
37-
aliases: ['sp'],
38-
description: oneLine`Override specs in the protractor config.
39-
Can send in multiple specs by repeating flag (ng e2e --specs=spec1.ts --specs=spec2.ts).`
40-
},
41-
{
42-
name: 'element-explorer',
43-
type: Boolean,
44-
default: false,
45-
aliases: ['ee'],
46-
description: 'Start Protractor\'s Element Explorer for debugging.'
47-
},
48-
{
49-
name: 'webdriver-update',
50-
type: Boolean,
51-
default: true,
52-
aliases: ['wu'],
53-
description: 'Try to update webdriver.'
54-
},
55-
{
56-
name: 'serve',
57-
type: Boolean,
58-
default: true,
59-
aliases: ['s'],
60-
description: oneLine`Compile and Serve the app.
61-
All non-reload related serve options are also available (e.g. --port=4400).`
62-
}
63-
]), [
64-
{ name: 'port', default: 0 },
65-
{
66-
name: 'watch',
67-
default: false,
68-
description: 'Run build when files change.'
69-
},
70-
]
71-
),
24+
availableOptions: overrideOptions([
25+
...baseServeCommandOptions,
26+
{
27+
name: 'config',
28+
type: String,
29+
aliases: ['c'],
30+
description: oneLine`
31+
Use a specific config file.
32+
Defaults to the protractor config file in angular-cli.json.
33+
`
34+
},
35+
{
36+
name: 'specs',
37+
type: Array,
38+
default: [],
39+
aliases: ['sp'],
40+
description: oneLine`
41+
Override specs in the protractor config.
42+
Can send in multiple specs by repeating flag (ng e2e --specs=spec1.ts --specs=spec2.ts).
43+
`
44+
},
45+
{
46+
name: 'element-explorer',
47+
type: Boolean,
48+
default: false,
49+
aliases: ['ee'],
50+
description: 'Start Protractor\'s Element Explorer for debugging.'
51+
},
52+
{
53+
name: 'webdriver-update',
54+
type: Boolean,
55+
default: true,
56+
aliases: ['wu'],
57+
description: 'Try to update webdriver.'
58+
},
59+
{
60+
name: 'serve',
61+
type: Boolean,
62+
default: true,
63+
aliases: ['s'],
64+
description: oneLine`
65+
Compile and Serve the app.
66+
All non-reload related serve options are also available (e.g. --port=4400).
67+
`
68+
}
69+
], [
70+
{
71+
name: 'port',
72+
default: 0,
73+
description: 'The port to use to serve the application.'
74+
},
75+
{
76+
name: 'watch',
77+
default: false,
78+
description: 'Run build when files change.'
79+
},
80+
]),
7281
run: function (commandOptions: E2eTaskOptions) {
7382
const E2eTask = require('../tasks/e2e').E2eTask;
7483
this.project.ngConfig = this.project.ngConfig || CliConfig.fromProject();

packages/@angular/cli/commands/eject.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ const Command = require('../ember-cli/lib/models/command');
66
// defaults for BuildOptions
77
export const baseEjectCommandOptions: any = [
88
...baseBuildCommandOptions,
9-
{ name: 'force', 'type': Boolean },
9+
{
10+
name: 'force',
11+
type: Boolean,
12+
description: 'Overwrite any webpack.config.js and npm scripts already existing.'
13+
},
1014
{
1115
name: 'app',
1216
type: String,

packages/@angular/cli/commands/get.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ const GetCommand = Command.extend({
1515
works: 'everywhere',
1616

1717
availableOptions: [
18-
{ name: 'global', type: Boolean, 'default': false }
18+
{
19+
name: 'global',
20+
type: Boolean,
21+
'default': false,
22+
description: 'Get the value in the global configuration (in your home directory).'
23+
}
1924
],
2025

2126
run: function (commandOptions: GetOptions, rawArgs: string[]): Promise<void> {

packages/@angular/cli/commands/lint.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import {oneLine} from 'common-tags';
2+
13
const Command = require('../ember-cli/lib/models/command');
24

5+
36
export interface LintCommandOptions {
47
fix?: boolean;
58
format?: string;
@@ -12,9 +15,27 @@ export default Command.extend({
1215
description: 'Lints code in existing project.',
1316
works: 'insideProject',
1417
availableOptions: [
15-
{ name: 'fix', type: Boolean, default: false },
16-
{ name: 'force', type: Boolean, default: false },
17-
{ name: 'format', alias: 't', type: String, default: 'prose' }
18+
{
19+
name: 'fix',
20+
type: Boolean,
21+
default: false,
22+
description: 'Fixes linting errors (may overwrite linted files).'
23+
},
24+
{
25+
name: 'force',
26+
type: Boolean,
27+
default: false,
28+
description: 'Succeeds even if there was linting errors.'
29+
},
30+
{
31+
name: 'format',
32+
alias: 't',
33+
type: String,
34+
default: 'prose',
35+
description: oneLine`
36+
Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist).
37+
`
38+
}
1839
],
1940
run: function (commandOptions: LintCommandOptions) {
2041
const LintTask = require('../tasks/lint').default;

packages/@angular/cli/commands/new.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ const NewCommand = Command.extend({
7171
name: 'skip-commit',
7272
type: Boolean,
7373
default: false,
74-
aliases: ['sc']
74+
aliases: ['sc'],
75+
description: 'Skip committing the first commit to git.'
7576
},
7677
{
7778
name: 'directory',

0 commit comments

Comments
 (0)