From 346b7196df61d19b9a115bea2c8bec8370068605 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 2 Aug 2020 16:57:25 -0400 Subject: [PATCH] New `-list-protocols` option This will make it possible for the Debian package to fetch the list of supported protocols and prompt the user to choose one upon installation. --- ddclient.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddclient.in b/ddclient.in index 9c63e58..2b73351 100755 --- a/ddclient.in +++ b/ddclient.in @@ -816,6 +816,10 @@ my %opt = (); my $deprecated_handler = sub { warning("'-$_[0]' is deprecated and does nothing"); }; $opt{'fw-banlocal'} = $deprecated_handler; $opt{'if-skip'} = $deprecated_handler; +$opt{'list-protocols'} = sub { + printf("%s\n", $_) for sort(keys(%services)); + exit(0); +}; $opt{'list-web-services'} = sub { printf("%s %s\n", $_, $builtinweb{$_}{url}) for sort(keys(%builtinweb)); exit(0); @@ -829,6 +833,7 @@ my @opt = ( ["proxy", "=s", "-proxy : use as the HTTP proxy"], ["server", "=s", "-server : update DNS information on "], ["protocol", "=s", "-protocol : update protocol used"], + ["list-protocols", "", "-list-protocols : print a machine-readable list of supported update protocols and exit. Format: one per line"], ["file", "=s", "-file : load configuration information from "], ["cache", "=s", "-cache : record address used in "], ["pid", "=s", "-pid : record process id in if daemonized"],