summaryrefslogtreecommitdiff
path: root/src/ver.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-06-25 15:14:07 +0300
committerTimo Teras <timo.teras@iki.fi>2009-06-25 15:14:07 +0300
commit7a29678aac20ac9e113704f8a5743f6051edef8d (patch)
tree11c9583a66fa5fc1122e6d993b92dc7cd591e237 /src/ver.c
parent3a488564753cee51832b6824128249a99eb4613b (diff)
downloadapk-tools-7a29678aac20ac9e113704f8a5743f6051edef8d.tar.gz
apk-tools-7a29678aac20ac9e113704f8a5743f6051edef8d.tar.bz2
apk-tools-7a29678aac20ac9e113704f8a5743f6051edef8d.tar.xz
apk-tools-7a29678aac20ac9e113704f8a5743f6051edef8d.zip
help: auto construct help
And add some more verbosity to the help message.
Diffstat (limited to 'src/ver.c')
-rw-r--r--src/ver.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ver.c b/src/ver.c
index 25da3eb..fc3e8d5 100644
--- a/src/ver.c
+++ b/src/ver.c
@@ -4,7 +4,7 @@
* Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
* All rights reserved.
*
- * This program is free software; you can redistribute it and/or modify it
+ * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation. See http://www.gnu.org/ for details.
*/
@@ -57,7 +57,7 @@ static int ver_validate(int argc, char **argv)
}
return r;
}
-
+
static int ver_parse(void *ctx, int opt, int optindex, const char *optarg)
{
struct ver_ctx *ictx = (struct ver_ctx *) ctx;
@@ -84,7 +84,7 @@ static void ver_print_package_status(struct apk_package *pkg)
latest = pkg;
for (i = 0; i < name->pkgs->num; i++) {
tmp = name->pkgs->item[i];
- if (tmp->name != name ||
+ if (tmp->name != name ||
apk_pkg_get_state(tmp) == APK_PKG_INSTALLED)
continue;
r = apk_pkg_version_compare(tmp, latest);
@@ -137,14 +137,15 @@ ver_exit:
return ret;
}
-static struct option ver_options[] = {
- { "test", no_argument, NULL, 't' },
- { "check", no_argument, NULL, 'c' },
+static struct apk_option ver_options[] = {
+ { 't', "test", "Compare two given versions" },
+ { 'c', "check", "Check if the given version string is valid" },
};
static struct apk_applet apk_ver = {
.name = "version",
- .usage = "[-t|--test version1 version2] [-c|--check]",
+ .help = "Compare package versions (in installed database vs. available)"
+ " or do tests on version strings given on command line.",
.context_size = sizeof(struct ver_ctx),
.num_options = ARRAY_SIZE(ver_options),
.options = ver_options,