Commit 537aef39 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Refactor: implement parse_key by using parse_key_list.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 699d2ec7
...@@ -664,26 +664,13 @@ parse_key_list (ArgParser& ap) ...@@ -664,26 +664,13 @@ parse_key_list (ArgParser& ap)
Key Key
parse_key (ArgParser& ap) parse_key (ArgParser& ap)
{ {
Key key; // default initialized with zero key auto key_list = parse_key_list (ap);
string s; if (key_list.size() > 1)
int i;
int have_key = 0;
if (ap.parse_opt ("--key", s))
{
have_key++;
key.load_key (s);
}
if (ap.parse_opt ("--test-key", i))
{
have_key++;
key.set_test_key (i);
}
if (have_key > 1)
{ {
error ("audiowmark: watermark key can at most be set once (--key / --test-key option)\n"); error ("audiowmark %s: watermark key can at most be set once (--key / --test-key option)\n", ap.command().c_str());
exit (1); exit (1);
} }
return key; return key_list[0];
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment