Skip to content

Commit

Permalink
Fix microsoft#10967, allow boolean flag to have explicit value
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme committed Oct 23, 2016
1 parent 3263fde commit 0918ffd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,13 @@ namespace ts {
i++;
break;
case "boolean":
options[opt.name] = true;
// boolean flag has optional value true, false, others
let optValue = args[i];
options[opt.name] = optValue !== "false";
// consume next argument as boolean flag value
if (optValue === "false" || optValue === "true") {
i++;
}
break;
case "string":
options[opt.name] = args[i] || "";
Expand Down

0 comments on commit 0918ffd

Please sign in to comment.