Skip to content

Commit

Permalink
fix(@angular/cli): add more description
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Feb 23, 2017
1 parent 7ebe4f0 commit b4594ba
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 146 deletions.
99 changes: 51 additions & 48 deletions packages/@angular/cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,78 +24,81 @@ export const baseBuildCommandOptions: any = [
description: 'Defines the build environment.'
},
{
name: 'output-path',
type: 'Path',
aliases: ['op'],
description: 'Path where output will be placed.'
name: 'output-path',
type: 'Path',
aliases: ['op'],
description: 'Path where output will be placed.'
},
{
name: 'aot',
type: Boolean,
description: 'Build using Ahead of Time compilation.'
name: 'aot',
type: Boolean,
description: 'Build using Ahead of Time compilation.'
},
{
name: 'sourcemap',
type: Boolean,
aliases: ['sm', 'sourcemaps'],
description: 'Output sourcemaps.'
name: 'sourcemap',
type: Boolean,
aliases: ['sm', 'sourcemaps'],
description: 'Output sourcemaps.'
},
{
name: 'vendor-chunk',
type: Boolean,
default: true,
aliases: ['vc'],
description: 'Use a separate bundle containing only vendor libraries.'
name: 'vendor-chunk',
type: Boolean,
default: true,
aliases: ['vc'],
description: 'Use a separate bundle containing only vendor libraries.'
},
{
name: 'base-href',
type: String,
aliases: ['bh'],
description: 'Base url for the application being built.'
name: 'base-href',
type: String,
aliases: ['bh'],
description: 'Base url for the application being built.'
},
{
name: 'deploy-url',
type: String,
aliases: ['d'],
description: 'URL where files will be deployed.'
name: 'deploy-url',
type: String,
aliases: ['d'],
description: 'URL where files will be deployed.'
},
{
name: 'verbose',
type: Boolean,
default: false,
aliases: ['v'],
description: 'Adds more details to output logging.'
name: 'verbose',
type: Boolean,
default: false,
aliases: ['v'],
description: 'Adds more details to output logging.'
},
{
name: 'progress',
type: Boolean,
default: true,
aliases: ['pr'],
description: 'Log progress to the console while building.'
name: 'progress',
type: Boolean,
default: true,
aliases: ['pr'],
description: 'Log progress to the console while building.'
},
{
name: 'i18n-file',
type: String
name: 'i18n-file',
type: String,
description: 'Localization file to use for i18n.'
},
{
name: 'i18n-format',
type: String
name: 'i18n-format',
type: String,
description: 'Format of the localization file specified with --i18n-file.'
},
{
name: 'locale',
type: String
name: 'locale',
type: String,
description: 'Locale to use for i18n.'
},
{
name: 'extract-css',
type: Boolean,
aliases: ['ec'],
description: 'Extract css from global styles onto css files instead of js ones.'
name: 'extract-css',
type: Boolean,
aliases: ['ec'],
description: 'Extract css from global styles onto css files instead of js ones.'
},
{
name: 'watch',
type: Boolean, default: false,
aliases: ['w'],
description: 'Run build when files change.'
name: 'watch',
type: Boolean, default: false,
aliases: ['w'],
description: 'Run build when files change.'
},
{
name: 'output-hashing',
Expand Down
26 changes: 22 additions & 4 deletions packages/@angular/cli/commands/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface CompletionCommandOptions {
all?: boolean;
bash?: boolean;
zsh?: boolean;
};
}

const commandsToIgnore = [
'destroy',
Expand All @@ -51,9 +51,27 @@ const CompletionCommand = Command.extend({
description: 'Adds autocomplete functionality to `ng` commands and subcommands.',
works: 'everywhere',
availableOptions: [
{ name: 'all', type: Boolean, default: true, aliases: ['a'] },
{ name: 'bash', type: Boolean, default: false, aliases: ['b'] },
{ name: 'zsh', type: Boolean, default: false, aliases: ['z'] }
{
name: 'all',
type: Boolean,
default: true,
aliases: ['a'],
description: 'Generate a completion script compatible with both bash and zsh.'
},
{
name: 'bash',
type: Boolean,
default: false,
aliases: ['b']
description: 'Generate a completion script for bash.'
},
{
name: 'zsh',
type: Boolean,
default: false,
aliases: ['z']
description: 'Generate a completion script for zsh.'
}
],

run: function (commandOptions: CompletionCommandOptions) {
Expand Down
105 changes: 57 additions & 48 deletions packages/@angular/cli/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,63 @@ const E2eCommand = Command.extend({
aliases: ['e'],
description: 'Run e2e tests in existing project.',
works: 'insideProject',
availableOptions: overrideOptions(
baseServeCommandOptions.concat([
{
name: 'config',
type: String,
aliases: ['c'],
description: oneLine`Use a specific config file.
Defaults to the protractor config file in angular-cli.json.`
},
{
name: 'specs',
type: Array,
default: [],
aliases: ['sp'],
description: oneLine`Override specs in the protractor config.
Can send in multiple specs by repeating flag (ng e2e --specs=spec1.ts --specs=spec2.ts).`
},
{
name: 'element-explorer',
type: Boolean,
default: false,
aliases: ['ee'],
description: 'Start Protractor\'s Element Explorer for debugging.'
},
{
name: 'webdriver-update',
type: Boolean,
default: true,
aliases: ['wu'],
description: 'Try to update webdriver.'
},
{
name: 'serve',
type: Boolean,
default: true,
aliases: ['s'],
description: oneLine`Compile and Serve the app.
All non-reload related serve options are also available (e.g. --port=4400).`
}
]), [
{ name: 'port', default: 0 },
{
name: 'watch',
default: false,
description: 'Run build when files change.'
},
]
),
availableOptions: overrideOptions([
...baseServeCommandOptions,
{
name: 'config',
type: String,
aliases: ['c'],
description: oneLine`
Use a specific config file.
Defaults to the protractor config file in angular-cli.json.
`
},
{
name: 'specs',
type: Array,
default: [],
aliases: ['sp'],
description: oneLine`
Override specs in the protractor config.
Can send in multiple specs by repeating flag (ng e2e --specs=spec1.ts --specs=spec2.ts).
`
},
{
name: 'element-explorer',
type: Boolean,
default: false,
aliases: ['ee'],
description: 'Start Protractor\'s Element Explorer for debugging.'
},
{
name: 'webdriver-update',
type: Boolean,
default: true,
aliases: ['wu'],
description: 'Try to update webdriver.'
},
{
name: 'serve',
type: Boolean,
default: true,
aliases: ['s'],
description: oneLine`
Compile and Serve the app.
All non-reload related serve options are also available (e.g. --port=4400).
`
}
], [
{
name: 'port',
default: 0,
description: 'The port to use to serve the application.'
},
{
name: 'watch',
default: false,
description: 'Run build when files change.'
},
]),
run: function (commandOptions: E2eTaskOptions) {
const E2eTask = require('../tasks/e2e').E2eTask;
this.project.ngConfig = this.project.ngConfig || CliConfig.fromProject();
Expand Down
6 changes: 5 additions & 1 deletion packages/@angular/cli/commands/eject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ const Command = require('../ember-cli/lib/models/command');
// defaults for BuildOptions
export const baseEjectCommandOptions: any = [
...baseBuildCommandOptions,
{ name: 'force', 'type': Boolean },
{
name: 'force',
type: Boolean,
description: 'Overwrite any webpack.config.js and npm scripts already existing.'
},
{
name: 'app',
type: String,
Expand Down
7 changes: 6 additions & 1 deletion packages/@angular/cli/commands/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const GetCommand = Command.extend({
works: 'everywhere',

availableOptions: [
{ name: 'global', type: Boolean, 'default': false }
{
name: 'global',
type: Boolean,
'default': false,
description: 'Get the value in the global configuration (in your home directory).'
}
],

run: function (commandOptions: GetOptions, rawArgs: string[]): Promise<void> {
Expand Down
27 changes: 24 additions & 3 deletions packages/@angular/cli/commands/lint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import {oneLine} from 'common-tags';

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


export interface LintCommandOptions {
fix?: boolean;
format?: string;
Expand All @@ -12,9 +15,27 @@ export default Command.extend({
description: 'Lints code in existing project.',
works: 'insideProject',
availableOptions: [
{ name: 'fix', type: Boolean, default: false },
{ name: 'force', type: Boolean, default: false },
{ name: 'format', alias: 't', type: String, default: 'prose' }
{
name: 'fix',
type: Boolean,
default: false,
description: 'Fixes linting errors (may overwrite linted files).'
},
{
name: 'force',
type: Boolean,
default: false,
description: 'Succeeds even if there was linting errors.'
},
{
name: 'format',
alias: 't',
type: String,
default: 'prose',
description: oneLine`
Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist).
`
}
],
run: function (commandOptions: LintCommandOptions) {
const LintTask = require('../tasks/lint').default;
Expand Down
3 changes: 2 additions & 1 deletion packages/@angular/cli/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ const NewCommand = Command.extend({
name: 'skip-commit',
type: Boolean,
default: false,
aliases: ['sc']
aliases: ['sc'],
description: 'Skip committing the first commit to git.'
},
{
name: 'directory',
Expand Down
Loading

0 comments on commit b4594ba

Please sign in to comment.