[pacman-dev] [PATCH] Give error message when --files will do nothing
Point people towards the help when using "pacman -F" or "pacman -F foo". Signed-off-by: Allan McRae <allan@archlinux.org> --- src/pacman/files.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pacman/files.c b/src/pacman/files.c index fb2f997..5741e45 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -294,7 +294,7 @@ int pacman_files(alpm_list_t *targets) } } - if(targets == NULL && (config->op_s_search || config->op_q_owns)) { + if(targets == NULL && !config->op_q_list) { pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -314,6 +314,11 @@ int pacman_files(alpm_list_t *targets) return files_list(files_dbs, targets); } + if(targets != NULL) { + pm_printf(ALPM_LOG_ERROR, _("no options specified (use -h for help)\n")); + return 1; + } + return 0; } -- 2.6.4
On 12/14/15 at 11:20pm, Allan McRae wrote:
Point people towards the help when using "pacman -F" or "pacman -F foo".
Signed-off-by: Allan McRae <allan@archlinux.org> ---
$ sudo ./pacman -Fy :: Synchronizing package databases... core is up to date extra is up to date community is up to date multilib is up to date error: no targets specified (use -h for help)
src/pacman/files.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/pacman/files.c b/src/pacman/files.c index fb2f997..5741e45 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -294,7 +294,7 @@ int pacman_files(alpm_list_t *targets) } }
- if(targets == NULL && (config->op_s_search || config->op_q_owns)) { + if(targets == NULL && !config->op_q_list) { pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n")); return 1; } @@ -314,6 +314,11 @@ int pacman_files(alpm_list_t *targets) return files_list(files_dbs, targets); }
+ if(targets != NULL) { + pm_printf(ALPM_LOG_ERROR, _("no options specified (use -h for help)\n")); + return 1; + } + return 0; }
-- 2.6.4
participants (2)
-
Allan McRae
-
Andrew Gregory