Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 75ce1bca..82765342 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -193,6 +193,13 @@ int main(int argc, char *argv[])
cleanup(1);
}
+ if(list_count(pm_targets) == 0 && !(config->op == PM_OP_QUERY || (config->op == PM_OP_SYNC
+ && (config->op_s_sync || config->op_s_upgrade || config->op_s_clean || config->group
+ || config->op_q_list)))) {
+ ERR(NL, "no targets specified (use -h for help)\n");
+ cleanup(1);
+ }
+
/* start the requested operation */
switch(config->op) {
case PM_OP_ADD: ret = pacman_add(pm_targets); break;
@@ -205,9 +212,6 @@ int main(int argc, char *argv[])
ERR(NL, "no operation specified (use -h for help)\n");
ret = 1;
}
- if(ret != 0 && config->op_d_vertest == 0) {
- MSG(NL, "\n");
- }
cleanup(ret);
/* not reached */
@@ -218,6 +222,10 @@ void cleanup(int signum)
{
list_t *lp;
+ if(signum != 0 && config->op_d_vertest == 0) {
+ fprintf(stderr, "\n");
+ }
+
/* free alpm library resources */
if(alpm_release() == -1) {
ERR(NL, "%s\n", alpm_strerror(pm_errno));