summaryrefslogtreecommitdiffstats
path: root/src/info.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-16 09:33:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-16 09:33:55 +0000
commit50daa05773a66fc94fd459011f51544b8b6e0517 (patch)
treedc9e320fd4e46923f5d8951a7e652d56e8dcec33 /src/info.c
parentaf6f329fc72bd93d2ac1a07ce6b23e510cf82ea8 (diff)
downloadapk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.tar.bz2
apk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.tar.xz
info: only show package desc when --verbose
also introduce apk_verbosity. --quiet reduce verbosity and --verbose increases it. Default verbosity is 1.
Diffstat (limited to 'src/info.c')
-rw-r--r--src/info.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/info.c b/src/info.c
index c981c18..1cde91d 100644
--- a/src/info.c
+++ b/src/info.c
@@ -26,8 +26,10 @@ static int info_list(struct apk_database *db, int argc, char **argv)
list_for_each_entry(pkg, &db->installed.packages, installed_pkgs_list) {
printf("%s", pkg->name->name);
- if (!apk_quiet)
- printf("-%s - %s", pkg->version, pkg->description);
+ if (apk_verbosity > 0)
+ printf("-%s", pkg->version);
+ if (apk_verbosity > 1)
+ printf("- %s", pkg->description);
printf("\n");
}
return 0;
@@ -66,7 +68,7 @@ static int info_who_owns(struct apk_database *db, int argc, char **argv)
if (pkg == NULL)
continue;
- if (apk_quiet) {
+ if (apk_verbosity < 1) {
dep = (struct apk_dependency) {
.name = pkg->name,
};
@@ -76,7 +78,7 @@ static int info_who_owns(struct apk_database *db, int argc, char **argv)
pkg->name->name, pkg->version);
}
}
- if (apk_quiet && deps != NULL) {
+ if (apk_verbosity < 1 && deps != NULL) {
char buf[512];
apk_deps_format(buf, sizeof(buf), deps);
printf("%s\n", buf);