summaryrefslogtreecommitdiffstats
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2008-02-19 00:44:09 +0100
committerDan McGee <dan@archlinux.org>2008-02-25 01:17:49 +0100
commit143135e666f5564240868810f0b8f4bc46ff87b5 (patch)
treed70bb426c06e9ee0dc94481ed5144aedca0bc54c /src/pacman/remove.c
parentca1a187131d95604ff2c33df3c1ec80ef4af789b (diff)
downloadpacman-143135e666f5564240868810f0b8f4bc46ff87b5.tar.gz
pacman-143135e666f5564240868810f0b8f4bc46ff87b5.tar.xz
Improve yesno function.
Add a preset paramater to yesno function saying which answer should be the default. Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-June/008470.html This allows us to answer no by default to some questions, like the -Scc one mentioned in the above thread, and implemented by this patch. Another advantage is that we don't have to repeat the [Y/n] in every questions. It's only put once in yesno function. This highly reduces the chances that YES and NO strings are translated, but not some questions, which lead to obvious confusions. Finally, the noconfirm variable only needs to be used in that yesno function. So all other usages of it were removed. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 4c5b5c09..a604014e 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -75,11 +75,11 @@ int pacman_remove(alpm_list_t *targets)
printf(_(":: group %s:\n"), alpm_grp_get_name(grp));
list_display(" ", pkgnames);
- all = yesno(_(" Remove whole content? [Y/n] "));
+ all = yesno(1, _(" Remove whole content?"));
for(p = pkgnames; p; p = alpm_list_next(p)) {
char *pkg = alpm_list_getdata(p);
- if(all || yesno(_(":: Remove %s from group %s? [Y/n] "), pkg, (char *)alpm_list_getdata(i))) {
+ if(all || yesno(1, _(":: Remove %s from group %s?"), pkg, (char *)alpm_list_getdata(i))) {
finaltargs = alpm_list_add(finaltargs, strdup(pkg));
}
}
@@ -155,7 +155,7 @@ int pacman_remove(alpm_list_t *targets)
list_display(_("Targets:"), lst);
FREELIST(lst);
/* get confirmation */
- if(yesno(_("\nDo you want to remove these packages? [Y/n] ")) == 0) {
+ if(yesno(1, _("\nDo you want to remove these packages?")) == 0) {
remove_cleanup();
FREELIST(finaltargs);
return(1);