From da3286a80d10ea3896ae09e9e753dc4f19fa3bf6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 26 Apr 2007 14:27:13 -0400 Subject: Allow sync search to work without arguments Enable an -Ss operation to work without a target list. This allows all package information to be printed (as opposed to individual -Sl operations on repositories). Signed-off-by: Dan McGee --- src/pacman/pacman.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 6178b71a..9949dd62 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -555,9 +555,14 @@ int main(int argc, char *argv[]) cleanup(1); } - if(alpm_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)))) { + /* TODO This is pretty messy, shouldn't checking be done later in the ops + * themselves? I can't even digest this if statement. */ + if(alpm_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_search + || config->op_s_clean || config->group + || config->op_q_list)))) { ERR(NL, _("no targets specified (use -h for help)\n")); cleanup(1); } -- cgit v1.2.3