diff options
author | Martin Szulecki | 2020-06-15 00:08:11 +0200 |
---|---|---|
committer | Martin Szulecki | 2020-06-15 00:08:11 +0200 |
commit | 06e70e0f51ad12931298c472688ff9a07ff0c535 (patch) | |
tree | 492587288e5faea0ad57f985b7d56ba2a5a7bb8a | |
parent | 5c48308014c9f94f6456464acc8ad17895aa7c7c (diff) | |
download | libusbmuxd-06e70e0f51ad12931298c472688ff9a07ff0c535.tar.gz libusbmuxd-06e70e0f51ad12931298c472688ff9a07ff0c535.tar.bz2 |
inetcat: Add new "--version" option to output version information
-rw-r--r-- | tools/inetcat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/inetcat.c b/tools/inetcat.c index af03dc0..1674c81 100644 --- a/tools/inetcat.c +++ b/tools/inetcat.c @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif + +#define TOOL_NAME "inetcat" + #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -90,6 +93,7 @@ static void print_usage(int argc, char **argv, int is_error) " -l, --local connect to USB device (default)\n" \ " -h, --help prints usage information\n" \ " -d, --debug increase debug level\n" \ + " -v, --version prints version information\n" \ "\n" \ "Homepage: <" PACKAGE_URL ">\n" "Bug Reports: <" PACKAGE_BUGREPORT ">\n" @@ -104,6 +108,7 @@ int main(int argc, char **argv) { "udid", required_argument, NULL, 'u' }, { "local", no_argument, NULL, 'l' }, { "network", no_argument, NULL, 'n' }, + { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0} }; @@ -111,7 +116,7 @@ int main(int argc, char **argv) static enum usbmux_lookup_options lookup_opts = 0; int c = 0; - while ((c = getopt_long(argc, argv, "dhu:ln", longopts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "dhu:lnv", longopts, NULL)) != -1) { switch (c) { case 'd': libusbmuxd_set_debug_level(++debug_level); @@ -134,6 +139,9 @@ int main(int argc, char **argv) case 'h': print_usage(argc, argv, 0); return 0; + case 'v': + printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); + return 0; default: print_usage(argc, argv, 1); return 2; |