Skip to content

Commit

Permalink
fix(Help): adding help descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitarora committed Feb 21, 2017
1 parent d1e13ac commit 2823688
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 52 deletions.
107 changes: 90 additions & 17 deletions packages/@angular/cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,89 @@ export const baseBuildCommandOptions: any = [
name: 'target',
type: String,
default: 'development',
aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }]
},
{ name: 'environment', type: String, aliases: ['e'] },
{ name: 'output-path', type: 'Path', aliases: ['op'] },
{ name: 'aot', type: Boolean },
{ name: 'sourcemap', type: Boolean, aliases: ['sm', 'sourcemaps'] },
{ name: 'vendor-chunk', type: Boolean, default: true, aliases: ['vc'] },
{ name: 'base-href', type: String, aliases: ['bh'] },
{ name: 'deploy-url', type: String, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'progress', type: Boolean, default: true, aliases: ['pr'] },
{ name: 'i18n-file', type: String },
{ name: 'i18n-format', type: String },
{ name: 'locale', type: String },
{ name: 'extract-css', type: Boolean, aliases: ['ec'] },
{ name: 'watch', type: Boolean, default: false, aliases: ['w'] },
aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }],
description: 'define the build target'
},
{
name: 'environment',
type: String,
aliases: ['e'] ,
description: 'defines the build environment'
},
{
name: 'output-path',
type: 'Path',
aliases: ['op'],
description: 'path where output will be placed'
},
{
name: 'aot',
type: Boolean,
description: 'flag whether to build using Ahead of Time compilation'
},
{
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: '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: '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: 'i18n-file',
type: String
},
{
name: 'i18n-format',
type: String
},
{
name: 'locale',
type: String
},
{
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: 'flag to run builds when files change'
},
{
name: 'output-hashing',
type: String,
Expand All @@ -54,7 +121,13 @@ const BuildCommand = Command.extend({
aliases: ['b'],

availableOptions: baseBuildCommandOptions.concat([
{ name: 'stats-json', type: Boolean, default: false }
{
name: 'stats-json',
type: Boolean,
default: false,
description: 'generates a `stats.json` file which can be analyzed using tools '
+ 'such as: `webpack-bundle-analyzer` or https://webpack.github.io/analyse'
}
]),

run: function (commandOptions: BuildTaskOptions) {
Expand Down
48 changes: 42 additions & 6 deletions packages/@angular/cli/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,50 @@ const E2eCommand = Command.extend({
works: 'insideProject',
availableOptions: overrideOptions(
baseServeCommandOptions.concat([
{ name: 'config', type: String, aliases: ['c'] },
{ name: 'specs', type: Array, default: [], aliases: ['sp'] },
{ name: 'element-explorer', type: Boolean, default: false, aliases: ['ee'] },
{ name: 'webdriver-update', type: Boolean, default: true, aliases: ['wu'] },
{ name: 'serve', type: Boolean, default: true, aliases: ['s'] }
{
name: 'config',
type: String,
aliases: ['c'],
description: 'use a specific config file.'
+ ' Defaults to the protractor config file in angular-cli.json'
},
{
name: 'specs',
type: Array,
default: [],
aliases: ['sp'],
description: '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: '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 },
{
name: 'watch',
default: false,
description: 'flag to run builds when files change'
},
]
),
run: function (commandOptions: E2eTaskOptions) {
Expand Down
115 changes: 100 additions & 15 deletions packages/@angular/cli/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,106 @@ const NewCommand = Command.extend({
works: 'outsideProject',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
{ name: 'ng4', type: Boolean, default: false },
{ name: 'skip-install', type: Boolean, default: false, aliases: ['si'] },
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
{ name: 'skip-tests', type: Boolean, default: false, aliases: ['st'] },
{ name: 'skip-commit', type: Boolean, default: false, aliases: ['sc'] },
{ name: 'directory', type: String, aliases: ['dir'] },
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
{ name: 'style', type: String, default: 'css' },
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] },
{ name: 'routing', type: Boolean, default: false },
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }
{
name: 'dry-run',
type: Boolean,
default: false,
aliases: ['d'],
description: 'run through without making any changes'
},
{
name: 'verbose',
type: Boolean,
default: false,
aliases: ['v'],
description: 'adds more details to output logging'
},
{
name: 'link-cli',
type: Boolean,
default: false,
aliases: ['lc'],
description: 'automatically link the `@angular/cli` package'
},
{
name: 'ng4',
type: Boolean,
default: false,
description: 'create a project with Angular 4 in the template'
},
{
name: 'skip-install',
type: Boolean,
default: false,
aliases: ['si'],
description: 'skip installing packages'
},
{
name: 'skip-git',
type: Boolean,
default: false,
aliases: ['sg'],
description: 'skip initializing a git repository'
},
{
name: 'skip-tests',
type: Boolean,
default: false,
aliases: ['st'],
description: 'skip creating spec files'
},
{
name: 'skip-commit',
type: Boolean,
default: false,
aliases: ['sc']
},
{
name: 'directory',
type: String,
aliases: ['dir'],
description: 'the directory name to create the app in'
},
{
name: 'source-dir',
type: String,
default: 'src',
aliases: ['sd'],
description: 'the name of the source directory'
},
{
name: 'style',
type: String,
default: 'css',
description: 'the style file default extension'
},
{
name: 'prefix',
type: String,
default: 'app',
aliases: ['p'],
description: 'the prefix to use for all component selectors'
},
{
name: 'routing',
type: Boolean,
default: false,
description: 'flag to indicate whether to generate a routing module'
},
{
name: 'inline-style',
type: Boolean,
default: false,
aliases: ['is'],
description: 'flag to indicate if the app component should have an inline style'
},
{
name: 'inline-template',
type: Boolean,
default: false,
aliases: ['it'],
description: 'flag to indicate if the app component should have an inline template'
}
],

run: function (commandOptions: any, rawArgs: string[]) {
Expand Down
84 changes: 72 additions & 12 deletions packages/@angular/cli/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,78 @@ export interface TestOptions {

const TestCommand = EmberTestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
{ name: 'code-coverage', type: Boolean, default: false, aliases: ['cc'] },
{ name: 'config', type: String, aliases: ['c'] },
{ name: 'single-run', type: Boolean, default: false, aliases: ['sr'] },
{ name: 'progress', type: Boolean, default: true},
{ name: 'browsers', type: String },
{ name: 'colors', type: Boolean },
{ name: 'log-level', type: String },
{ name: 'port', type: Number },
{ name: 'reporters', type: String },
{ name: 'build', type: Boolean, default: true },
{ name: 'sourcemap', type: Boolean, default: true, aliases: ['sm'] },
{
name: 'watch',
type: Boolean,
default: true,
aliases: ['w'],
description: 'flag to run builds when files change'
},
{
name: 'code-coverage',
type: Boolean,
default: false,
aliases: ['cc'],
description: 'coverage report will be in the coverage/ directory'
},
{
name: 'config',
type: String,
aliases: ['c'],
description: 'use a specific config file.'
+ ' Defaults to the protractor config file in angular-cli.json'
},
{
name: 'single-run',
type: Boolean,
default: false,
aliases: ['sr'],
description: 'run tests a single time'
},
{
name: 'progress',
type: Boolean,
default: true,
description: 'log progress to the console while in progress'
},
{
name: 'browsers',
type: String,
description: 'override which browsers tests are run against'
},
{
name: 'colors',
type: Boolean,
description: 'enable or disable colors in the output (reporters and logs)'
},
{
name: 'log-level',
type: String,
description: 'level of logging'
},
{
name: 'port',
type: Number,
description: 'port where the web server will be listening'
},
{
name: 'reporters',
type: String,
description: 'list of reporters to use'
},
{
name: 'build',
type: Boolean,
default: true,
description: 'flag to build prior to running tests'
},
{
name: 'sourcemap',
type: Boolean,
default: true,
aliases: ['sm'],
description: 'output sourcemaps'
},
{
name: 'poll',
type: Number,
Expand Down
Loading

0 comments on commit 2823688

Please sign in to comment.