diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-05-23 11:12:09 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-05-23 11:12:09 +0100 |
| commit | b8784f4d1484dbd5a907f14c0e20306203c09bd5 (patch) | |
| tree | 3738fd9567d48b377c35f4d8211e6a3208fe7ee7 | |
| parent | 095b0c42cf7be01b6463becb7bf957656b738c0e (diff) | |
| download | rabbitmq-server-git-b8784f4d1484dbd5a907f14c0e20306203c09bd5.tar.gz | |
on a second thought, it is better to reject options with missing arguments
| -rw-r--r-- | src/rabbit_misc.erl | 3 | ||||
| -rw-r--r-- | src/rabbit_tests.erl | 4 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 661a4cb4e4..1d7d39e77b 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -785,8 +785,7 @@ process_opts(Defs, C, [A | As], Found, KVs, Outs) -> Defs, C, As, Found, dict:store(A, true, KVs), Outs); {option, _, _} -> case As of - [] -> process_opts(Defs, C, [], Found, - KVs, [A | Outs]); + [] -> no_command; [V | As1] -> process_opts( Defs, C, As1, Found, dict:store(A, V, KVs), Outs) diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 7c287b0adc..bae4928de4 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -837,10 +837,6 @@ test_arguments_parser() -> %% If the flag "eats" the command, the command won't be recognised check_parse_arguments(no_command, GetOptions, ["-o1", "command1", "quux"]), - %% If the flag doesn't have an argument, it won't be recognised - check_parse_arguments( - {ok, {command1, [{"-f1", false}, {"-o1", "foo"}], ["-o1"]}}, - GetOptions, ["command1", "-o1"]), %% If a flag eats another flag, the eaten flag won't be recognised check_parse_arguments( {ok, {command1, [{"-f1", false}, {"-o1", "-f1"}], []}}, |
