File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,10 @@ function parse (args, opts) {
372372 unsetDefaulted ( key )
373373
374374 if ( / - / . test ( key ) && configuration [ 'camel-case-expansion' ] ) {
375- addNewAlias ( key , camelCase ( key ) )
375+ var alias = key . split ( '.' ) . map ( function ( prop ) {
376+ return camelCase ( prop )
377+ } ) . join ( '.' )
378+ addNewAlias ( key , alias )
376379 }
377380
378381 var value = processValue ( key , val )
Original file line number Diff line number Diff line change @@ -1115,6 +1115,15 @@ describe('yargs-parser', function () {
11151115
11161116 argv . fooBar . should . equal ( 99 )
11171117 } )
1118+
1119+ // Fixes: https://github.com/yargs/yargs-parser/issues/77
1120+ it ( 'should combine dot-notation and camel-case expansion' , function ( ) {
1121+ var argv = parser ( [ '--dot-notation.foo.bar' ] )
1122+
1123+ argv . should . satisfy ( function ( args ) {
1124+ return args . dotNotation . foo . bar
1125+ } )
1126+ } )
11181127 } )
11191128
11201129 it ( 'should define option as boolean and set default to true' , function ( ) {
You can’t perform that action at this time.
0 commit comments