Skip to content

fix(@angular/cli): Fixing duplicate aliases issue#4987

Merged
hansl merged 1 commit into
angular:masterfrom
sumitarora:fix-aliases
Mar 2, 2017
Merged

fix(@angular/cli): Fixing duplicate aliases issue#4987
hansl merged 1 commit into
angular:masterfrom
sumitarora:fix-aliases

Conversation

@sumitarora
Copy link
Copy Markdown
Contributor

@sumitarora sumitarora commented Feb 24, 2017

ng —help calls validateAndRun twice once to check if callHelp function is to be triggered and once actually for command lookup and mutates the state of aliases. normalizeOption is what is mutating the aliases which is called from parseArgs from validateAndRun.

The current fix is to check for aliases in the list of aliases and only add it if it's not previously present else continue as usual.

Fixes: #4979

@sumitarora sumitarora force-pushed the fix-aliases branch 2 times, most recently from 0f900ba to a33de72 Compare February 27, 2017 15:40
@filipesilva
Copy link
Copy Markdown
Contributor

I'm not too sure this is the right approach, it just seems to treat the symptom.

The core issue is that we get different output between ng help new and ng new --help:

kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng help new
ng new <options...>
  Creates a new directory and a new Angular app.
  --dry-run (Boolean) (Default: false) Run through without making any changes.
    aliases: -d, --dryRun
  --verbose (Boolean) (Default: false) Adds more details to output logging.
    aliases: -v, --verbose
// ...

kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng new --help
ng new <options...>
  Creates a new directory and a new Angular app.
  --dry-run (Boolean) (Default: false) Run through without making any changes.
    aliases: -d, --dryRun, --dryRun
  --verbose (Boolean) (Default: false) Adds more details to output logging.
    aliases: -v, --verbose, --verbose
// ...

Why is that happening? Aren't those two essentially the same?

@hansl hansl merged commit 0fc2190 into angular:master Mar 2, 2017
@sumitarora sumitarora deleted the fix-aliases branch March 24, 2017 16:35
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng commands with --help flag output redundant alias

5 participants