You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In which outDir is parsed as a positional argument. This makes sense because outDir is not presented in string, even though its kebab-case variation presented.
However, when I set an alias for out-dir, It behaves in another way:
In which the former unknown option outDir is parsed as a named argument now. I don't know if there are some implicit conversions under the hood?
If the camel-case conversion is intended, I hope the first example will treat outDir as a known named argument too.
Tested in the current version of yargs-parser@20.2.6
The text was updated successfully, but these errors were encountered:
weareoutman
changed the title
Strange implicitly camel-case conversion when use both unknown-options-as-args and alias
Strange implicit camel-case conversion when use both unknown-options-as-args and alias
Mar 6, 2021
Given code below:
This will print:
In which
outDir
is parsed as a positional argument. This makes sense becauseoutDir
is not presented instring
, even though its kebab-case variation presented.However, when I set an alias for
out-dir
, It behaves in another way:This will print:
In which the former unknown option
outDir
is parsed as a named argument now. I don't know if there are some implicit conversions under the hood?If the camel-case conversion is intended, I hope the first example will treat
outDir
as a known named argument too.Tested in the current version of yargs-parser@20.2.6
The text was updated successfully, but these errors were encountered: