On Monday 04 June 2007 03:51:38 Dan McGee wrote:
On 6/3/07, Roman Kyrylych <roman.kyrylych@gmail.com> wrote:
/* full cleanup */ - if(!yesno(_("Do you want to remove all packages from cache? [Y/n] "))) + if(yesno(_("Do you want to remove all packages from cache? [y/N] "))) return(0); printf(_("removing all packages from cache... "));
This change doesn't work quite as you intended, Roman. yesno() returns a 1 on three conditions- a 'Y' or 'YES' is entered, or nothing at all was entered. Thus, there is no easy way to change the default answer from Y. yesno() will need to be rewritten to support a parameter saying which answer should be the default.
Can't it simply return 1 for a yes, 0 for a nothing-at-all and -1 for a no, or something like it? I think it would be cleaner. -- Dag Odenhall <xmpp:dag.odenhall@jabber.se>