[pacman-dev] [PATCH] scripts/pacman-key.sh.in: fix processing of --help/-h and --version/-V options
allan at archlinux.org
Wed Mar 30 00:30:31 EDT 2011
On 30/03/11 07:22, ivan.kanak at gmail.com wrote:
> From: Ivan Kanakarakis<ivan.kanak at gmail.com>
> ok, I think this is much better. The process is as follows:
> The script first tries to read the options as defined in the usage.
> It then expects to read a command. If the command exists and it's one of --help/-h/--version/-V
> it skips any check and goes straight to the case loop, and thus executes those.
> If the command is something else, it enters the big if block and checks for the needed conditions.
> also when an unknown command is given there now an error message instead of just the usage
> unknown command:<--the_command>
> some more comments:
> I saw some things like
> error "$(gettext "The key identified by %s doesn't exist")" "$1"
> while error() only knows about the first argument given to it, so %s there is actually left blank.
> also I think there are some cases where gettext is redundant as in called twice for the same text.
> I can go fixing this too.
> Signed-off-by: Ivan Kanakarakis<ivan.kanak at gmail.com>
I'll add a note that we also have this patch floating about that
actually handles --config and --gpgdir properly. (among other changes).
More information about the pacman-dev