From 041e51f68d14b826e81ee4a1716623fc04b27c38 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Thu, 16 Feb 2006 22:57:25 +0000 Subject: sync with pacman 2.9.8 --- src/pacman/pacman.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/pacman/pacman.c') 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)); -- cgit v1.2.3