Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

When an addition argument is parsed the schematic commands should fail with an error.

Fixes #12549

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Jan 19, 2019
@alan-agius4 alan-agius4 reopened this Jan 19, 2019
When an addition argument is parsed the schematic commands should fail with an error.

Fixes #12549
@alan-agius4 alan-agius4 requested a review from clydin January 20, 2019 13:08
@clydin clydin added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jan 29, 2019
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this has the potential to cause unintentional failures for existing users, targeting 8.0 may be the safer option.

@alan-agius4
Copy link
Collaborator Author

alan-agius4 commented Jan 29, 2019

caretaker: this is for version 8

}

// ng-add is special because we don't know all possible options at this point
if (args['--'] && schematicName !== 'ng-add') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing schematicName == ng-add why not use a this.validateAdditionalArgs() or maybe a allowAdditionalArgs getter that is false for the base command class, true for add?

People can still ng generate something:ng-add and it would trigger this condition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will follow up on this as I like the idea.

@hansl hansl merged commit f8e873b into angular:master Jan 30, 2019
@alan-agius4 alan-agius4 deleted the fix-unknown-options-schematics branch January 30, 2019 20:51
@angular-automatic-lock-bot
Copy link

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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng new should error on multiple args

4 participants