@@ -132,14 +132,6 @@ function parse (args, opts) {
132
132
} )
133
133
134
134
var argv = { _ : [ ] }
135
-
136
- Object . keys ( flags . bools ) . forEach ( function ( key ) {
137
- if ( Object . prototype . hasOwnProperty . call ( defaults , key ) ) {
138
- setArg ( key , defaults [ key ] )
139
- setDefaulted ( key )
140
- }
141
- } )
142
-
143
135
var notFlags = [ ]
144
136
145
137
for ( var i = 0 ; i < args . length ; i ++ ) {
@@ -406,8 +398,6 @@ function parse (args, opts) {
406
398
}
407
399
408
400
function setArg ( key , val ) {
409
- unsetDefaulted ( key )
410
-
411
401
if ( / - / . test ( key ) && configuration [ 'camel-case-expansion' ] ) {
412
402
var alias = key . split ( '.' ) . map ( function ( prop ) {
413
403
return camelCase ( prop )
@@ -704,7 +694,7 @@ function parse (args, opts) {
704
694
}
705
695
} else if ( o [ key ] === undefined && isTypeArray ) {
706
696
o [ key ] = isValueArray ? value : [ value ]
707
- } else if ( duplicate && ! ( o [ key ] === undefined || checkAllAliases ( key , flags . bools ) || checkAllAliases ( keys . join ( '.' ) , flags . bools ) || checkAllAliases ( key , flags . counts ) ) ) {
697
+ } else if ( duplicate && ! ( o [ key ] === undefined || checkAllAliases ( key , flags . counts ) ) ) {
708
698
o [ key ] = [ o [ key ] , value ]
709
699
} else {
710
700
o [ key ] = value
@@ -762,19 +752,7 @@ function parse (args, opts) {
762
752
return isSet
763
753
}
764
754
765
- function setDefaulted ( key ) {
766
- [ ] . concat ( flags . aliases [ key ] || [ ] , key ) . forEach ( function ( k ) {
767
- flags . defaulted [ k ] = true
768
- } )
769
- }
770
-
771
- function unsetDefaulted ( key ) {
772
- [ ] . concat ( flags . aliases [ key ] || [ ] , key ) . forEach ( function ( k ) {
773
- delete flags . defaulted [ k ]
774
- } )
775
- }
776
-
777
- // make a best effor to pick a default value
755
+ // make a best effort to pick a default value
778
756
// for an option based on name and type.
779
757
function defaultValue ( key ) {
780
758
if ( ! checkAllAliases ( key , flags . bools ) &&
0 commit comments