From 807f014d777fbcc7b43fa5159a8b0d12a44d63ae Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 12 Oct 2013 13:32:06 -0400 Subject: 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 Signed-off-by: Allan McRae --- src/pacman/pacman.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 0ba357bb..f4856924 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -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; } } -- cgit v1.2.3-54-g00ecf