From 61d509733ea88bfbc2651985174a91acad970075 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 31 Mar 2008 13:10:53 +0000 Subject: create add_urpmf_binary_op() and add_urpmf_unary_op(), nothing changed yet (see next commit) --- urpm/args.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/urpm/args.pm b/urpm/args.pm index bff9bded..38ead349 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -205,13 +205,13 @@ my %options_spec = ( f => sub { $::full = 1 }, 'F=s' => sub { $::separator = $_[1] }, 'e=s' => sub { $::expr .= "($_[1])" }, - a => sub { $::expr .= ' && ' }, - o => sub { $::expr .= ' || ' }, + a => sub { add_urpmf_binary_op('&&') }, + o => sub { add_urpmf_binary_op('||') }, '<>' => sub { my $p = shift; if ($p =~ /^-?([!()])$/) { # This is for -! -( -) - $::expr .= $1; + add_urpmf_unary_op($1); } elsif ($p =~ /^--?(.+)/) { # unrecognized option @@ -354,6 +354,16 @@ sub add_urpmf_cmdline_tags { } } +sub add_urpmf_binary_op { + my ($op) = @_; + + $::expr .= " $op "; +} +sub add_urpmf_unary_op { + my ($op) = @_; + + $::expr .= $op; +} sub add_urpmf_parameter { my ($p) = @_; -- cgit v1.2.1