Added -version argument

This commit is contained in:
Lenard Hess 2024-02-03 13:31:26 +01:00
parent f5a1a906d1
commit bab66330ca

View file

@ -1090,6 +1090,7 @@ my @opt = (
["verbose", "!", "-{no}verbose : print {no} verbose information"],
["quiet", "!", "-{no}quiet : print {no} messages for unnecessary updates"],
["help", "", "-help : display this message and exit"],
["version", "", "-version : display version information and exit"],
["postscript", "", "-postscript : script to run after updating ddclient, has new IP as param"],
["query", "!", "-{no}query : print {no} ip addresses and exit"],
["fw-banlocal", "!", ""], ## deprecated
@ -1099,7 +1100,8 @@ my @opt = (
["redirect", "=i", "-redirect <max> : enable and follow at most <max> HTTP 30x redirections"],
"",
nic_examples(),
"$program version $version, ",
# Note: These lines are copied below to the -version argument implementation
"$program version $version",
" originally written by Paul Burry, paul+ddclient\@burry.ca",
" project now maintained on https://github.com/ddclient/ddclient"
);
@ -1118,6 +1120,13 @@ sub main {
exit 0;
}
if (opt('version')) {
# Note: Manual copy from the @opt array above!
print "$program version $version\n";
print " originally written by Paul Burry, paul+ddclient\@burry.ca\n";
print " project now maintained on https://github.com/ddclient/ddclient\n";
}
## read config file because 'daemon' mode may be defined there.
read_config($opt{'file'} // default('file'), \%config, \%globals);
init_config();