Skip to content

Commit

Permalink
Merge pull request #174 from sparkprime/dash
Browse files Browse the repository at this point in the history
A single - is no-longer treated as an invalid option
  • Loading branch information
sparkprime committed May 9, 2016
2 parents dc990ec + edc558c commit b8b867e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/jsonnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static bool process_args(int argc,
config->evalStream = true;
} else if (arg == "-S" || arg == "--string") {
jsonnet_string_output(vm, 1);
} else if (arg[0] == '-') {
} else if (arg.length() > 1 && arg[0] == '-') {
std::cerr << "ERROR: Unrecognized argument: " << arg << std::endl;
return EXIT_FAILURE;
} else {
Expand Down Expand Up @@ -439,6 +439,9 @@ static bool process_args(int argc,
jsonnet_fmt_pretty_field_names(vm, false);
} else if (arg == "--debug-desugaring") {
jsonnet_fmt_debug_desugaring(vm, true);
} else if (arg.length() > 1 && arg[0] == '-') {
std::cerr << "ERROR: Unrecognized argument: " << arg << std::endl;
return EXIT_FAILURE;
} else {
remaining_args.push_back(args[i]);
}
Expand Down

0 comments on commit b8b867e

Please sign in to comment.