From 50daa05773a66fc94fd459011f51544b8b6e0517 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 16 Jan 2009 09:33:55 +0000 Subject: info: only show package desc when --verbose also introduce apk_verbosity. --quiet reduce verbosity and --verbose increases it. Default verbosity is 1. --- src/info.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/info.c') 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); -- cgit v1.2.3-60-g2f50