@@ -1053,7 +1053,6 @@ function Yargs (processArgs, cwd, parentRequire) {
10531053 for ( let i = ( commandIndex || 0 ) , cmd ; argv . _ [ i ] !== undefined ; i ++ ) {
10541054 cmd = String ( argv . _ [ i ] )
10551055 if ( ~ handlerKeys . indexOf ( cmd ) && cmd !== completionCommand ) {
1056- setPlaceholderKeys ( argv )
10571056 // commands are executed using a recursive algorithm that executes
10581057 // the deepest command first; we keep track of the position in the
10591058 // argv._ array that is currently being executed.
@@ -1066,7 +1065,6 @@ function Yargs (processArgs, cwd, parentRequire) {
10661065
10671066 // run the default command, if defined
10681067 if ( command . hasDefaultCommand ( ) && ! skipDefaultCommand ) {
1069- setPlaceholderKeys ( argv )
10701068 return command . runCommand ( null , self , parsed )
10711069 }
10721070
@@ -1084,7 +1082,6 @@ function Yargs (processArgs, cwd, parentRequire) {
10841082 self . exit ( 0 )
10851083 }
10861084 } else if ( command . hasDefaultCommand ( ) && ! skipDefaultCommand ) {
1087- setPlaceholderKeys ( argv )
10881085 return command . runCommand ( null , self , parsed )
10891086 }
10901087
@@ -1103,7 +1100,7 @@ function Yargs (processArgs, cwd, parentRequire) {
11031100
11041101 self . exit ( 0 )
11051102 } )
1106- return setPlaceholderKeys ( argv )
1103+ return argv
11071104 }
11081105
11091106 // Handle 'help' and 'version' options
@@ -1147,7 +1144,7 @@ function Yargs (processArgs, cwd, parentRequire) {
11471144 else throw err
11481145 }
11491146
1150- return setPlaceholderKeys ( argv )
1147+ return argv
11511148 }
11521149
11531150 self . _runValidation = function runValidation ( argv , aliases , positionalMap , parseErrors ) {
@@ -1173,16 +1170,6 @@ function Yargs (processArgs, cwd, parentRequire) {
11731170 }
11741171 }
11751172
1176- function setPlaceholderKeys ( argv ) {
1177- Object . keys ( options . key ) . forEach ( ( key ) => {
1178- // don't set placeholder keys for dot
1179- // notation options 'foo.bar'.
1180- if ( ~ key . indexOf ( '.' ) ) return
1181- if ( typeof argv [ key ] === 'undefined' ) argv [ key ] = undefined
1182- } )
1183- return argv
1184- }
1185-
11861173 // an app should almost always have --version and --help,
11871174 // if you *really* want to disable this use .help(false)/.version(false).
11881175 self . help ( )
0 commit comments