From edc558c72542c5cb42f6e30cc629d70e9bd7bab9 Mon Sep 17 00:00:00 2001 From: Dave Cunningham Date: Mon, 2 May 2016 10:48:55 -0400 Subject: [PATCH] A single - is no-longer treated as an invalid option --- cmd/jsonnet.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/jsonnet.cpp b/cmd/jsonnet.cpp index 51c2255f3..3449d407f 100644 --- a/cmd/jsonnet.cpp +++ b/cmd/jsonnet.cpp @@ -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 { @@ -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]); }