diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-10-10 10:35:47 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-10-15 02:10:28 +0200 |
commit | e23024ccfff661ad5aee7c122a1833a103fbb971 (patch) | |
tree | 141f6d4bdb54532dc469bab272a2c945e12612c9 /conf.c | |
parent | 2074b332f9c6d533c7adb46491b3a4b7461cc110 (diff) | |
download | passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.gz passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.bz2 passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.lz passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.xz passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.zst passt-e23024ccfff661ad5aee7c122a1833a103fbb971.zip |
conf, log, Makefile: Add versioning information
Add a --version option displaying that, and also include this
information in the log files.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -626,6 +626,7 @@ static void usage(const char *name) } info(""); + info( " -d, --debug Be verbose, don't run in background"); info( " --trace Be extra verbose, implies --debug"); info( " -q, --quiet Don't print informational messages"); @@ -640,6 +641,7 @@ static void usage(const char *name) info( " numeric, or login and group names"); info( " default: drop to user \"nobody\""); info( " -h, --help Display this help message and exit"); + info( " --version Show version and exit"); if (strstr(name, "pasta")) { info( " -I, --ns-ifname NAME namespace interface name"); @@ -1039,6 +1041,7 @@ void conf(struct ctx *c, int argc, char **argv) {"trace", no_argument, NULL, 11 }, {"runas", required_argument, NULL, 12 }, {"log-size", required_argument, NULL, 13 }, + {"version", no_argument, NULL, 14 }, { 0 }, }; struct get_bound_ports_ns_arg ns_ports_arg = { .c = c }; @@ -1197,6 +1200,11 @@ void conf(struct ctx *c, int argc, char **argv) usage(argv[0]); } break; + case 14: + fprintf(stdout, + c->mode == MODE_PASST ? "passt " : "pasta "); + fprintf(stdout, VERSION_BLOB); + exit(EXIT_SUCCESS); case 'd': if (c->debug) { err("Multiple --debug options given"); |