From 9f3235b2efc471a7ac362a621316cb2d3e0cef1c Mon Sep 17 00:00:00 2001 From: Taro Tanaka Date: Sun, 8 Jan 2023 23:48:15 +0900 Subject: [PATCH] Allow -q to argumentless -Qg/-Sgg as well Like other query operations. This may not be very useful, but even -Qs/-Ss with no arguments accept -q, so let's follow the convention and be consistent. Signed-off-by: Taro Tanaka --- src/pacman/query.c | 12 ++++++++---- src/pacman/sync.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/pacman/query.c b/src/pacman/query.c index a60bbf96..13003f5b 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -367,10 +367,14 @@ static int query_group(alpm_list_t *targets) if(!filter(pkg)) { continue; } - printf("%s%s %s%s %s%s%s\n", colstr->groups, grp->name, - colstr->title, alpm_pkg_get_name(pkg), - colstr->version, alpm_pkg_get_version(pkg), - colstr->nocolor); + if(!config->quiet) { + printf("%s%s %s%s %s%s%s\n", colstr->groups, grp->name, + colstr->title, alpm_pkg_get_name(pkg), + colstr->version, alpm_pkg_get_version(pkg), + colstr->nocolor); + } else { + printf("%s\n", alpm_pkg_get_name(pkg)); + } } } } else { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 93225bab..ab55fa71 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -374,12 +374,16 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) if(level > 1) { for(k = grp->packages; k; k = alpm_list_next(k)) { - printf("%s%s %s%s %s%s%s", colstr->groups, grp->name, - colstr->title, alpm_pkg_get_name(k->data), - colstr->version, alpm_pkg_get_version(k->data), - colstr->nocolor); - print_installed(db_local, k->data); - printf("\n"); + if(!config->quiet) { + printf("%s%s %s%s %s%s%s", colstr->groups, grp->name, + colstr->title, alpm_pkg_get_name(k->data), + colstr->version, alpm_pkg_get_version(k->data), + colstr->nocolor); + print_installed(db_local, k->data); + printf("\n"); + } else { + printf("%s\n", alpm_pkg_get_name(k->data)); + } } } else { /* print grp names only, no package names */