1. Mathias Panzenböck
  2. JavaScript Brainf***

Commits

Mathias Panzenböck  committed 2f0f4a2

detect already existing default value for flag targets

  • Participants
  • Parent commits 751f0bd
  • Branches default

Comments (0)

Files changed (1)

File getopt.js

View file
  • Ignore whitespace
 				optdef.argc  = -1;
 	
 				if (optdef.default === undefined) {
-					optdef.default = false;
+					optdef.default = this.defaultValues[name];
+
+					if (optdef.default === undefined) {
+						optdef.default = false;
+					}
 				}
 				break;