check_value: Mention supported values if given an invalid value
This commit is contained in:
parent
ed2afde72d
commit
19848852a4
1 changed files with 8 additions and 4 deletions
12
ddclient.in
12
ddclient.in
|
@ -2594,7 +2594,8 @@ sub check_value {
|
|||
|
||||
} elsif ($type eq T_PROTO) {
|
||||
$value = lc $value;
|
||||
die("invalid $type: $orig\n") if !exists $protocols{$value};
|
||||
die("invalid $type: $orig\nSupported values: ", join(' ', sort(keys(%protocols))), "\n")
|
||||
if !exists $protocols{$value};
|
||||
|
||||
} elsif ($type eq T_URL) {
|
||||
die("invalid $type: $orig\n")
|
||||
|
@ -2603,16 +2604,19 @@ sub check_value {
|
|||
} elsif ($type eq T_USE) {
|
||||
$value = lc $value;
|
||||
$value = 'disabled' if $value eq 'no'; # backwards compatibility
|
||||
die("invalid $type: $orig\n") if !exists($ip_strategies{$value});
|
||||
die(map(($_, "\n"), "invalid $type: $orig", 'Supported values:', ip_strategies_usage()))
|
||||
if !exists($ip_strategies{$value});
|
||||
|
||||
} elsif ($type eq T_USEV4) {
|
||||
$value = lc $value;
|
||||
die("invalid $type: $orig\n") if !exists($ipv4_strategies{$value});
|
||||
die(map(($_, "\n"), "invalid $type: $orig", 'Supported values:', ipv4_strategies_usage()))
|
||||
if !exists($ipv4_strategies{$value});
|
||||
|
||||
} elsif ($type eq T_USEV6) {
|
||||
$value = lc $value;
|
||||
$value = 'disabled' if $value eq 'no'; # backwards compatibility
|
||||
die("invalid $type: $orig\n") if !exists($ipv6_strategies{$value});
|
||||
die(map(($_, "\n"), "invalid $type: $orig", 'Supported values:', ipv6_strategies_usage()))
|
||||
if !exists($ipv6_strategies{$value});
|
||||
|
||||
} elsif ($type eq T_FILE) {
|
||||
die("invalid $type: $orig\n") if $value eq "";
|
||||
|
|
Loading…
Reference in a new issue