diff options
author | Martin Szulecki | 2014-10-16 02:30:15 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-16 02:30:15 +0200 |
commit | ee2d9225a1e8c6123b153d33f570749590b42911 (patch) | |
tree | b5ad06f3d17a06e55190fdf1eed058b0e9fef3dd | |
parent | da256eb3990cb0d76b0829cdb327a0bac8ba1d90 (diff) | |
download | libideviceactivation-ee2d9225a1e8c6123b153d33f570749590b42911.tar.gz libideviceactivation-ee2d9225a1e8c6123b153d33f570749590b42911.tar.bz2 |
ideviceactivation: Add "--version" argument to print version number and exit
-rw-r--r-- | man/ideviceactivation.1 | 3 | ||||
-rw-r--r-- | tools/ideviceactivation.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/man/ideviceactivation.1 b/man/ideviceactivation.1 index 8de1d4a..433324b 100644 --- a/man/ideviceactivation.1 +++ b/man/ideviceactivation.1 @@ -27,6 +27,9 @@ Prints usage information. .TP .B \-s, \-\-service URL Use activation webservice at URL instead of default. +.TP +.B \-v, \-\-version +Print version information and exit. .SH COMMANDS .TP diff --git a/tools/ideviceactivation.c b/tools/ideviceactivation.c index 547dfe6..aafce71 100644 --- a/tools/ideviceactivation.c +++ b/tools/ideviceactivation.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -43,6 +47,7 @@ static void print_usage(int argc, char **argv) printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -u, --udid UDID\ttarget specific device by its 40-digit device UDID\n"); printf(" -s, --service URL\tuse activation webservice at URL instead of default\n"); + printf(" -v, --version\t\tprint version information and exit\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); } @@ -101,6 +106,10 @@ int main(int argc, char *argv[]) print_usage(argc, argv); return EXIT_SUCCESS; } + else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { + printf("ideviceactivation %s\n", PACKAGE_VERSION); + return EXIT_SUCCESS; + } else if (!strcmp(argv[i], "activate")) { op = OP_ACTIVATE; continue; |