diff options
author | Sami Kerola <kerolasa@iki.fi> | 2018-01-14 11:56:34 +0000 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2018-10-03 20:21:37 +0100 |
commit | 1b1559cc77c562fa424eb920ba009276fb180ec6 (patch) | |
tree | 1942d4d31c7d611cbc557a0eaa28381e9211640a | |
parent | fb14ff365d92e39a9a370072023d47824a3e909b (diff) | |
download | iputils-1b1559cc77c562fa424eb920ba009276fb180ec6.tar.gz |
add version print out to remaining commands
For some reason version print out was not implemented in all commands. This
fixes that.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | clockdiff.c | 5 | ||||
-rw-r--r-- | doc/clockdiff.xml | 7 | ||||
-rw-r--r-- | doc/ninfod.xml | 7 | ||||
-rw-r--r-- | doc/rarpd.xml | 7 | ||||
-rw-r--r-- | doc/tftpd.xml | 1 | ||||
-rw-r--r-- | doc/tracepath.xml | 7 | ||||
-rw-r--r-- | ninfod/ninfod.c | 6 | ||||
-rw-r--r-- | rarpd.c | 7 | ||||
-rw-r--r-- | tftpd.c | 5 | ||||
-rw-r--r-- | tracepath.c | 6 |
10 files changed, 54 insertions, 4 deletions
diff --git a/clockdiff.c b/clockdiff.c index 2efea5d..fe9ca8d 100644 --- a/clockdiff.c +++ b/clockdiff.c @@ -561,6 +561,7 @@ void usage(void) " without -o, use ip timestamp only\n" " -o use ip timestamp and icmp echo\n" " -o1 use three-term ip timestamp and icmp echo\n" + " -V print version and exit\n" " <destination> dns name or ip address\n" "\nFor more details see clockdiff(8).\n" ); @@ -593,6 +594,10 @@ main(int argc, char *argv[]) int s_errno = 0; int n_errno = 0; + if (argc == 2 && !strcmp(argv[1], "-V")) { + printf(IPUTILS_VERSION("clockdiff")); + return 0; + } if (argc < 2) { drop_rights(); usage(); diff --git a/doc/clockdiff.xml b/doc/clockdiff.xml index fcbbd16..0286967 100644 --- a/doc/clockdiff.xml +++ b/doc/clockdiff.xml @@ -22,6 +22,7 @@ <command>clockdiff</command> <arg choice='opt'>-o </arg> <arg choice='opt'>-o1 </arg> + <arg choice='opt'>-V </arg> <arg choice='plain'><replaceable>destination</replaceable></arg> <sbr/> </cmdsynopsis> @@ -55,6 +56,12 @@ What flavor works better depends on target host. Particularly, <option>-o</option> is better for Linux.</para> </listitem> </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <listitem> + <para>Print version and exit.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/doc/ninfod.xml b/doc/ninfod.xml index 7e8617d..3ceb5bb 100644 --- a/doc/ninfod.xml +++ b/doc/ninfod.xml @@ -23,6 +23,7 @@ <arg choice='opt'>-dhv </arg> <arg choice='opt'>-p <replaceable>pidfile</replaceable></arg> <arg choice='opt'>-u <replaceable>user</replaceable></arg> + <arg choice='opt'>-V </arg> <sbr/> </cmdsynopsis> </refsynopsisdiv> @@ -69,6 +70,12 @@ Queries can be sent by various implementations of <emphasis remap='B'>ping6</emp <emphasis remap='I'>user</emphasis> is required to be able to create the file.</para> </listitem> </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <listitem> + <para>Print version and exit.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/doc/rarpd.xml b/doc/rarpd.xml index afa788d..a7629ed 100644 --- a/doc/rarpd.xml +++ b/doc/rarpd.xml @@ -22,6 +22,7 @@ <command>arping</command> <arg choice='opt'>-aAvde </arg> <arg choice='opt'>-b <replaceable>bootdir</replaceable></arg> + <arg choice='opt'>-V </arg> <arg choice='opt'><replaceable>interface</replaceable></arg> <sbr/> </cmdsynopsis> @@ -96,6 +97,12 @@ database and DNS.</para> <para>TFTP boot directory. Default is <filename>/etc/tftpboot</filename></para> </listitem> </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <listitem> + <para>Print version and exit.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/doc/tftpd.xml b/doc/tftpd.xml index ace367f..9c32a1a 100644 --- a/doc/tftpd.xml +++ b/doc/tftpd.xml @@ -20,6 +20,7 @@ <refsynopsisdiv id='synopsis'> <cmdsynopsis> <command>tftpd</command> + <arg choice='opt'>-V </arg> <arg choice='plain'><replaceable>directory</replaceable></arg> <sbr/> </cmdsynopsis> diff --git a/doc/tracepath.xml b/doc/tracepath.xml index 268e1b3..40942e5 100644 --- a/doc/tracepath.xml +++ b/doc/tracepath.xml @@ -28,6 +28,7 @@ <arg choice='opt'>-l <replaceable>pktlen</replaceable></arg> <arg choice='opt'>-m <replaceable>max_hops</replaceable></arg> <arg choice='opt'>-p <replaceable>port</replaceable></arg> + <arg choice='opt'>-V </arg> <arg choice='plain'><replaceable>destination</replaceable></arg> <sbr/> </cmdsynopsis> @@ -97,6 +98,12 @@ instead of 30.</para> <para>Sets the initial destination port to use.</para> </listitem> </varlistentry> + <varlistentry> + <term><option>-V</option></term> + <listitem> + <para>Print version and exit.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c index 0e88ff3..bc657b7 100644 --- a/ninfod/ninfod.c +++ b/ninfod/ninfod.c @@ -578,7 +578,7 @@ static void parse_args(int argc, char **argv) char *ep; /* parse options */ - while ((c = getopt(argc, argv, "dhvp:u:")) != -1) { + while ((c = getopt(argc, argv, "dhvp:u:V")) != -1) { switch(c) { case 'd': /* debug */ opt_d = 1; @@ -601,6 +601,9 @@ static void parse_args(int argc, char **argv) } else opt_u = val; break; + case 'V': + printf(IPUTILS_VERSION("ninfod")); + exit(0); case 'h': /* help */ default: opt_h = 1; @@ -635,6 +638,7 @@ static void print_usage(void) { " -p <pidfile> file to store process-id\n" " -u <user> run <user>\n" " -v verbose mode\n" + " -V print version and exit\n" "\nFor more details see ninfod(8).\n" ); } @@ -86,6 +86,7 @@ void usage(void) " -d debug mode\n" " -e /etc/ethers markup alone is fine\n" " -v verbose mode\n" + " -V print version and exit\n" "\nFor more details see rarpd(8).\n" ); exit(1); @@ -575,7 +576,7 @@ int main(int argc, char **argv) opterr = 0; - while ((opt = getopt(argc, argv, "aAb:dvoe")) != EOF) { + while ((opt = getopt(argc, argv, "aAb:dvoeV")) != EOF) { switch (opt) { case 'a': ++all_ifaces; @@ -604,7 +605,9 @@ int main(int argc, char **argv) case 'b': tftp_dir = optarg; break; - + case 'V': + printf(IPUTILS_VERSION("rarpd")); + return 0; default: usage(); } @@ -87,6 +87,11 @@ int main(int ac, char **av) int n = 0; int on = 1; + if (ac == 2 && !strcmp(av[1], "-V")) { + printf(IPUTILS_VERSION("tftpd")); + return 0; + } + openlog("tftpd", LOG_PID, LOG_DAEMON); /* Sanity. If parent forgot to setuid() on us. */ diff --git a/tracepath.c b/tracepath.c index 82d72cb..e4974d5 100644 --- a/tracepath.c +++ b/tracepath.c @@ -384,6 +384,7 @@ static void usage(void) " -m <hops> use maximum <hops>\n" " -n no dns name resolution\n" " -p <port> use destination <port>\n" + " -V print version and exit\n" " <destination> dns name or ip address\n" "\nFor more details see tracepath(8).\n" ); @@ -420,7 +421,7 @@ int main(int argc, char **argv) else if (argv[0][strlen(argv[0])-1] == '6') hints.ai_family = AF_INET6; - while ((ch = getopt(argc, argv, "46nbh?l:m:p:")) != EOF) { + while ((ch = getopt(argc, argv, "46nbh?l:m:p:V")) != EOF) { switch(ch) { case '4': if (hints.ai_family != AF_UNSPEC) { @@ -460,6 +461,9 @@ int main(int argc, char **argv) case 'p': base_port = atoi(optarg); break; + case 'V': + printf(IPUTILS_VERSION("tracepath")); + return 0; default: usage(); } |