diff --git a/ddclient.in b/ddclient.in index 8659b3d..7b58ab0 100755 --- a/ddclient.in +++ b/ddclient.in @@ -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 : enable and follow at most 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();