Added -version argument
This commit is contained in:
parent
f5a1a906d1
commit
bab66330ca
1 changed files with 10 additions and 1 deletions
11
ddclient.in
11
ddclient.in
|
@ -1090,6 +1090,7 @@ my @opt = (
|
||||||
["verbose", "!", "-{no}verbose : print {no} verbose information"],
|
["verbose", "!", "-{no}verbose : print {no} verbose information"],
|
||||||
["quiet", "!", "-{no}quiet : print {no} messages for unnecessary updates"],
|
["quiet", "!", "-{no}quiet : print {no} messages for unnecessary updates"],
|
||||||
["help", "", "-help : display this message and exit"],
|
["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"],
|
["postscript", "", "-postscript : script to run after updating ddclient, has new IP as param"],
|
||||||
["query", "!", "-{no}query : print {no} ip addresses and exit"],
|
["query", "!", "-{no}query : print {no} ip addresses and exit"],
|
||||||
["fw-banlocal", "!", ""], ## deprecated
|
["fw-banlocal", "!", ""], ## deprecated
|
||||||
|
@ -1099,7 +1100,8 @@ my @opt = (
|
||||||
["redirect", "=i", "-redirect <max> : enable and follow at most <max> HTTP 30x redirections"],
|
["redirect", "=i", "-redirect <max> : enable and follow at most <max> HTTP 30x redirections"],
|
||||||
"",
|
"",
|
||||||
nic_examples(),
|
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",
|
" originally written by Paul Burry, paul+ddclient\@burry.ca",
|
||||||
" project now maintained on https://github.com/ddclient/ddclient"
|
" project now maintained on https://github.com/ddclient/ddclient"
|
||||||
);
|
);
|
||||||
|
@ -1118,6 +1120,13 @@ sub main {
|
||||||
exit 0;
|
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 file because 'daemon' mode may be defined there.
|
||||||
read_config($opt{'file'} // default('file'), \%config, \%globals);
|
read_config($opt{'file'} // default('file'), \%config, \%globals);
|
||||||
init_config();
|
init_config();
|
||||||
|
|
Loading…
Reference in a new issue