Skip to content

Commit fbf391d

Browse files
committed
fix(Help): adding help descriptions
1 parent 2c1e877 commit fbf391d

File tree

11 files changed

+347
-69
lines changed

11 files changed

+347
-69
lines changed

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

Lines changed: 93 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CliConfig } from '../models/config';
22
import { BuildOptions } from '../models/build-options';
33
import { Version } from '../upgrade/version';
4+
import { oneLine } from 'common-tags';
45

56
const Command = require('../ember-cli/lib/models/command');
67

@@ -13,34 +14,101 @@ export const baseBuildCommandOptions: any = [
1314
name: 'target',
1415
type: String,
1516
default: 'development',
16-
aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }]
17-
},
18-
{ name: 'environment', type: String, aliases: ['e'] },
19-
{ name: 'output-path', type: 'Path', aliases: ['op'] },
20-
{ name: 'aot', type: Boolean },
21-
{ name: 'sourcemap', type: Boolean, aliases: ['sm', 'sourcemaps'] },
22-
{ name: 'vendor-chunk', type: Boolean, default: true, aliases: ['vc'] },
23-
{ name: 'base-href', type: String, aliases: ['bh'] },
24-
{ name: 'deploy-url', type: String, aliases: ['d'] },
25-
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
26-
{ name: 'progress', type: Boolean, default: true, aliases: ['pr'] },
27-
{ name: 'i18n-file', type: String },
28-
{ name: 'i18n-format', type: String },
29-
{ name: 'locale', type: String },
30-
{ name: 'extract-css', type: Boolean, aliases: ['ec'] },
31-
{ name: 'watch', type: Boolean, default: false, aliases: ['w'] },
17+
aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }],
18+
description: 'Defines the build target.'
19+
},
20+
{
21+
name: 'environment',
22+
type: String,
23+
aliases: ['e'] ,
24+
description: 'Defines the build environment.'
25+
},
26+
{
27+
name: 'output-path',
28+
type: 'Path',
29+
aliases: ['op'],
30+
description: 'Path where output will be placed.'
31+
},
32+
{
33+
name: 'aot',
34+
type: Boolean,
35+
description: 'Build using Ahead of Time compilation.'
36+
},
37+
{
38+
name: 'sourcemap',
39+
type: Boolean,
40+
aliases: ['sm', 'sourcemaps'],
41+
description: 'Output sourcemaps.'
42+
},
43+
{
44+
name: 'vendor-chunk',
45+
type: Boolean,
46+
default: true,
47+
aliases: ['vc'],
48+
description: 'Use a separate bundle containing only vendor libraries.'
49+
},
50+
{
51+
name: 'base-href',
52+
type: String,
53+
aliases: ['bh'],
54+
description: 'Base url for the application being built.'
55+
},
56+
{
57+
name: 'deploy-url',
58+
type: String,
59+
aliases: ['d'],
60+
description: 'URL where files will be deployed.'
61+
},
62+
{
63+
name: 'verbose',
64+
type: Boolean,
65+
default: false,
66+
aliases: ['v'],
67+
description: 'Adds more details to output logging.'
68+
},
69+
{
70+
name: 'progress',
71+
type: Boolean,
72+
default: true,
73+
aliases: ['pr'],
74+
description: 'Log progress to the console while building.'
75+
},
76+
{
77+
name: 'i18n-file',
78+
type: String
79+
},
80+
{
81+
name: 'i18n-format',
82+
type: String
83+
},
84+
{
85+
name: 'locale',
86+
type: String
87+
},
88+
{
89+
name: 'extract-css',
90+
type: Boolean,
91+
aliases: ['ec'],
92+
description: 'Extract css from global styles onto css files instead of js ones.'
93+
},
94+
{
95+
name: 'watch',
96+
type: Boolean, default: false,
97+
aliases: ['w'],
98+
description: 'Run build when files change.'
99+
},
32100
{
33101
name: 'output-hashing',
34102
type: String,
35103
values: ['none', 'all', 'media', 'bundles'],
36-
description: 'define the output filename cache-busting hashing mode',
104+
description: 'Define the output filename cache-busting hashing mode.',
37105
aliases: ['oh']
38106
},
39107
{
40108
name: 'poll',
41109
type: Number,
42110
default: pollDefault,
43-
description: 'enable and define the file watching poll time period (milliseconds)'
111+
description: 'Enable and define the file watching poll time period (milliseconds).'
44112
}
45113
];
46114

@@ -54,7 +122,13 @@ const BuildCommand = Command.extend({
54122
aliases: ['b'],
55123

56124
availableOptions: baseBuildCommandOptions.concat([
57-
{ name: 'stats-json', type: Boolean, default: false }
125+
{
126+
name: 'stats-json',
127+
type: Boolean,
128+
default: false,
129+
description: oneLine`Generates a \`stats.json\` file which can be analyzed using tools
130+
such as: \`webpack-bundle-analyzer\` or https://webpack.github.io/analyse.`
131+
}
58132
]),
59133

60134
run: function (commandOptions: BuildTaskOptions) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const optsNg: string[] = [];
4848

4949
const CompletionCommand = Command.extend({
5050
name: 'completion',
51-
description: 'Adds autocomplete functionality to `ng` commands and subcommands',
51+
description: 'Adds autocomplete functionality to `ng` commands and subcommands.',
5252
works: 'everywhere',
5353
availableOptions: [
5454
{ name: 'all', type: Boolean, default: true, aliases: ['a'] },

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

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { overrideOptions } from '../utilities/override-options';
44
import { CliConfig } from '../models/config';
55
import { ServeTaskOptions, baseServeCommandOptions } from './serve';
66
import { checkPort } from '../utilities/check-port';
7+
import { oneLine } from 'common-tags';
78
const Command = require('../ember-cli/lib/models/command');
89

910

@@ -18,18 +19,54 @@ export interface E2eTaskOptions extends ServeTaskOptions {
1819
const E2eCommand = Command.extend({
1920
name: 'e2e',
2021
aliases: ['e'],
21-
description: 'Run e2e tests in existing project',
22+
description: 'Run e2e tests in existing project.',
2223
works: 'insideProject',
2324
availableOptions: overrideOptions(
2425
baseServeCommandOptions.concat([
25-
{ name: 'config', type: String, aliases: ['c'] },
26-
{ name: 'specs', type: Array, default: [], aliases: ['sp'] },
27-
{ name: 'element-explorer', type: Boolean, default: false, aliases: ['ee'] },
28-
{ name: 'webdriver-update', type: Boolean, default: true, aliases: ['wu'] },
29-
{ name: 'serve', type: Boolean, default: true, aliases: ['s'] }
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+
}
3063
]), [
3164
{ name: 'port', default: 0 },
32-
{ name: 'watch', default: false },
65+
{
66+
name: 'watch',
67+
default: false,
68+
description: 'Run build when files change.'
69+
},
3370
]
3471
),
3572
run: function (commandOptions: E2eTaskOptions) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const commandsToIgnore = [
1313

1414
const HelpCommand = Command.extend({
1515
name: 'help',
16-
description: 'Shows help for the CLI',
16+
description: 'Shows help for the CLI.',
1717
works: 'everywhere',
1818

1919
availableOptions: [],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface LintCommandOptions {
99
export default Command.extend({
1010
name: 'lint',
1111
aliases: ['l'],
12-
description: 'Lints code in existing project',
12+
description: 'Lints code in existing project.',
1313
works: 'insideProject',
1414
availableOptions: [
1515
{ name: 'fix', type: Boolean, default: false },

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

Lines changed: 100 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,106 @@ const NewCommand = Command.extend({
1919
works: 'outsideProject',
2020

2121
availableOptions: [
22-
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
23-
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
24-
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
25-
{ name: 'ng4', type: Boolean, default: false },
26-
{ name: 'skip-install', type: Boolean, default: false, aliases: ['si'] },
27-
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
28-
{ name: 'skip-tests', type: Boolean, default: false, aliases: ['st'] },
29-
{ name: 'skip-commit', type: Boolean, default: false, aliases: ['sc'] },
30-
{ name: 'directory', type: String, aliases: ['dir'] },
31-
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
32-
{ name: 'style', type: String, default: 'css' },
33-
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] },
34-
{ name: 'routing', type: Boolean, default: false },
35-
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
36-
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }
22+
{
23+
name: 'dry-run',
24+
type: Boolean,
25+
default: false,
26+
aliases: ['d'],
27+
description: 'Run through without making any changes.'
28+
},
29+
{
30+
name: 'verbose',
31+
type: Boolean,
32+
default: false,
33+
aliases: ['v'],
34+
description: 'Adds more details to output logging.'
35+
},
36+
{
37+
name: 'link-cli',
38+
type: Boolean,
39+
default: false,
40+
aliases: ['lc'],
41+
description: 'Automatically link the `@angular/cli` package.'
42+
},
43+
{
44+
name: 'ng4',
45+
type: Boolean,
46+
default: false,
47+
description: 'Create a project with Angular 4 in the template.'
48+
},
49+
{
50+
name: 'skip-install',
51+
type: Boolean,
52+
default: false,
53+
aliases: ['si'],
54+
description: 'Skip installing packages.'
55+
},
56+
{
57+
name: 'skip-git',
58+
type: Boolean,
59+
default: false,
60+
aliases: ['sg'],
61+
description: 'Skip initializing a git repository.'
62+
},
63+
{
64+
name: 'skip-tests',
65+
type: Boolean,
66+
default: false,
67+
aliases: ['st'],
68+
description: 'Skip creating spec files.'
69+
},
70+
{
71+
name: 'skip-commit',
72+
type: Boolean,
73+
default: false,
74+
aliases: ['sc']
75+
},
76+
{
77+
name: 'directory',
78+
type: String,
79+
aliases: ['dir'],
80+
description: 'The directory name to create the app in.'
81+
},
82+
{
83+
name: 'source-dir',
84+
type: String,
85+
default: 'src',
86+
aliases: ['sd'],
87+
description: 'The name of the source directory.'
88+
},
89+
{
90+
name: 'style',
91+
type: String,
92+
default: 'css',
93+
description: 'The style file default extension.'
94+
},
95+
{
96+
name: 'prefix',
97+
type: String,
98+
default: 'app',
99+
aliases: ['p'],
100+
description: 'The prefix to use for all component selectors.'
101+
},
102+
{
103+
name: 'routing',
104+
type: Boolean,
105+
default: false,
106+
description: 'Generate a routing module.'
107+
},
108+
{
109+
name: 'inline-style',
110+
type: Boolean,
111+
default: false,
112+
aliases: ['is'],
113+
description: 'Should have an inline style.'
114+
},
115+
{
116+
name: 'inline-template',
117+
type: Boolean,
118+
default: false,
119+
aliases: ['it'],
120+
description: 'Should have an inline template.'
121+
}
37122
],
38123

39124
isProject: function (projectPath: string) {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const baseServeCommandOptions: any = overrideOptions(
3434
type: String,
3535
default: defaultHost,
3636
aliases: ['H'],
37-
description: `Listens only on ${defaultHost} by default`
37+
description: `Listens only on ${defaultHost} by default.`
3838
},
3939
{ name: 'proxy-config', type: 'Path', aliases: ['pc'] },
4040
{ name: 'ssl', type: Boolean, default: false },
@@ -45,19 +45,19 @@ export const baseServeCommandOptions: any = overrideOptions(
4545
type: Boolean,
4646
default: false,
4747
aliases: ['o'],
48-
description: 'Opens the url in default browser',
48+
description: 'Opens the url in default browser.',
4949
},
5050
{ name: 'live-reload', type: Boolean, default: true, aliases: ['lr'] },
5151
{
5252
name: 'live-reload-client',
5353
type: String,
54-
description: 'specify the URL that the live reload browser client will use'
54+
description: 'Specify the URL that the live reload browser client will use.'
5555
},
5656
{
5757
name: 'hmr',
5858
type: Boolean,
5959
default: false,
60-
description: 'Enable hot module replacement',
60+
description: 'Enable hot module replacement.',
6161
}
6262
]), [
6363
{ name: 'watch', default: true },

0 commit comments

Comments
 (0)