mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
include invalid options in error messages
On invalid combinations of flags we were only printing the unhelpfully vague message "invalid option". Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
2c11e5da1d
commit
807f014d77
@ -128,7 +128,8 @@ enum {
|
||||
|
||||
/* Long Operations */
|
||||
enum {
|
||||
OP_NOCONFIRM = 1000,
|
||||
OP_LONG_FLAG_MIN = 1000,
|
||||
OP_NOCONFIRM,
|
||||
OP_CONFIG,
|
||||
OP_IGNORE,
|
||||
OP_DEBUG,
|
||||
|
@ -947,7 +947,12 @@ static int parseargs(int argc, char *argv[])
|
||||
result = parsearg_global(opt);
|
||||
if(result != 0) {
|
||||
/* global option parsing failed, abort */
|
||||
pm_printf(ALPM_LOG_ERROR, _("invalid option\n"));
|
||||
if(opt < OP_LONG_FLAG_MIN) {
|
||||
pm_printf(ALPM_LOG_ERROR, _("invalid option '-%c'\n"), opt);
|
||||
} else {
|
||||
pm_printf(ALPM_LOG_ERROR, _("invalid option '--%s'\n"),
|
||||
opts[option_index].name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user