diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-16 09:33:55 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-16 09:33:55 +0000 |
commit | 50daa05773a66fc94fd459011f51544b8b6e0517 (patch) | |
tree | dc9e320fd4e46923f5d8951a7e652d56e8dcec33 /src/info.c | |
parent | af6f329fc72bd93d2ac1a07ce6b23e510cf82ea8 (diff) | |
download | apk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.tar.gz apk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.tar.bz2 apk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.tar.xz apk-tools-50daa05773a66fc94fd459011f51544b8b6e0517.zip |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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); |