]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Add a `-v` flag to just get version number.
authorVincent Bernat <bernat@luffy.cx>
Fri, 18 May 2012 05:33:47 +0000 (07:33 +0200)
committerVincent Bernat <bernat@luffy.cx>
Fri, 18 May 2012 05:33:47 +0000 (07:33 +0200)
Closes #18.

man/lldpctl.8
man/lldpd.8
src/lldpctl.c
src/lldpd.c

index dac8c054ab9171ebbb6642fb30153815e8d052c2..18191fea492202f0414485f396090ec849c34d62 100644 (file)
@@ -21,8 +21,7 @@
 .Nd control LLDP daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl d
-.Op Fl a
+.Op Fl adv
 .Op Fl L Ar location
 .Op Fl P Ar policy
 .Op Fl O Ar poe
@@ -45,6 +44,10 @@ The options are as follows:
 .Bl -tag -width Ds
 .It Fl d
 Enable more debugging information.
+.It Fl v
+Show
+.Nm
+version.
 .It Fl a
 Display all remote ports, including those hidden by the smart filter.
 .It Fl f Ar format
index 4cf0ee31ea3475db85a0beac1a3cddb365e502a6..49f1449484c3b3bae97a86650f623821c210e0fb 100644 (file)
@@ -21,7 +21,7 @@
 .Nd LLDP daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl dxcseiklr
+.Op Fl dxcseiklrv
 .Op Fl S Ar description
 .Op Fl P Ar platform
 .Op Fl X Ar socket
@@ -175,6 +175,10 @@ transmit sensible information like serial numbers.
 Filter neighbors. See section
 .Sx FILTERING NEIGHBORS
 for details.
+.It Fl v
+Show
+.Nm
+version.
 .El
 .Sh FILTERING NEIGHBORS
 In a heterogeneous network, you may see several different hosts on the
index d4ff8d88a406b611eeca111699520cd4a42e3723..436ac2e856f61e0a8e56d1cf21c9736244244859 100644 (file)
@@ -33,7 +33,7 @@ extern const char     *__progname;
 # define __progname "lldpctl"
 #endif
 
-#define LLDPCTL_ARGS "hdaf:L:P:O:o:"
+#define LLDPCTL_ARGS "hdvaf:L:P:O:o:"
 
 static void
 usage(void)
@@ -717,6 +717,10 @@ main(int argc, char *argv[])
                case 'd':
                        debug++;
                        break;
+               case 'v':
+                       fprintf(stdout, "%s\n", PACKAGE_VERSION);
+                       exit(0);
+                       break;
                case 'a':
                        hidden = 1;
                        break;
index 8595b45396457a5c9639116f1ad391fa50d30b03..1880c3fb08597ce5401ad2d3531ecd5488dd0fae 100644 (file)
@@ -1029,7 +1029,7 @@ lldpd_main(int argc, char *argv[])
        char *cidp = NULL;
        char *interfaces = NULL;
        char *popt, opts[] = 
-               "H:hkrdxX:m:4:6:I:C:p:M:P:S:i@                    ";
+               "H:vhkrdxX:m:4:6:I:C:p:M:P:S:i@                    ";
        int i, found, advertise_version = 1;
 #ifdef ENABLE_LLDPMED
        int lldpmed = 0, noinventory = 0;
@@ -1061,6 +1061,10 @@ lldpd_main(int argc, char *argv[])
                case 'h':
                        usage();
                        break;
+               case 'v':
+                       fprintf(stdout, "%s\n", PACKAGE_VERSION);
+                       exit(0);
+                       break;
                case 'd':
                        debug++;
                        break;