File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -564,7 +564,7 @@ function parse (args, opts) {
564564
565565 var key = keys [ keys . length - 1 ]
566566
567- var isTypeArray = checkAllAliases ( key , flags . arrays )
567+ var isTypeArray = checkAllAliases ( keys . join ( '.' ) , flags . arrays )
568568 var isValueArray = Array . isArray ( value )
569569 var duplicate = configuration [ 'duplicate-arguments-array' ]
570570
Original file line number Diff line number Diff line change @@ -2056,6 +2056,17 @@ describe('yargs-parser', function () {
20562056
20572057 parsed [ 'x' ] . should . deep . equal ( [ 'a' , 'b' ] )
20582058 } )
2059+
2060+ it ( 'flattens duplicate array type, when argument uses dot notation' , function ( ) {
2061+ var parsed = parser ( '-x.foo a -x.foo b' , {
2062+ array : [ 'x.foo' ] ,
2063+ configuration : {
2064+ 'flatten-duplicate-arrays' : true
2065+ }
2066+ } )
2067+
2068+ parsed [ 'x' ] . should . deep . equal ( { foo : [ 'a' , 'b' ] } )
2069+ } )
20592070 } )
20602071
20612072 describe ( 'duplicate-arguments-array VS flatten-duplicate-arrays' , function ( ) {
You can’t perform that action at this time.
0 commit comments