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>
This commit is contained in:
Allan McRae 2015-12-14 23:17:26 +10:00
parent d721bae443
commit 686fae6d74
1 changed files with 6 additions and 1 deletions

View File

@ -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_owns | config->op_s_search)) {
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;
}