Parser: Schematics options camelCase coercion #13544
Labels
area: @angular-devkit/schematics-cli
feature: insufficient votes
Label to add when the not a sufficient number of votes or comments from unique authors
feature
Issue that requests a new feature
Milestone
🚀 Feature request
Command (mark with an
x
)Description
When passing arguments to
schematics
as options, I would like to be able to pass a dash-case option (i.e.---dry-run
) and get the camelCase equivalent (i.e.dryRun
) in the options passed to my schematic.Currently, if I pass the option
option-one
as a dash-case argument...The factory function will receive the following options object...
Furthermore, if I were to pass both the dash-case and camelCase equivalent of the same argument like so...
The factory function will receive the following options object...
This is not only very confusing but also inconsistent with the base schematics options such as
--dry-run
. Meaning that the following two commands are analogous...Thereby treating
dry-run
asdryRun
. I don't see a great use case for allowing two arguments of different cases to coexist.Describe the solution you'd like
Option 1
Coerce all options argument to camelCase.
Option 2
Smart case corecursion of all options argument based on options schema.
Describe alternatives you've considered
Checking for both dash-case and camelCase options and resolving each option manually based on expected options schema.
The text was updated successfully, but these errors were encountered: