[Rt-devel] PATCH: allow rt command to sort multiple object
IDs/Names without warnings
Ruslan Zakirov
ruslan.zakirov at gmail.com
Tue Jun 27 21:09:30 EDT 2006
Please, resubmit your patches as attachments and in unified diff format.
On 6/28/06, Philip Kime <pkime at shopzilla.com> wrote:
> Patch is against 3.6.0 rt command.
>
> *** /root/rt-3.6.0.orig 2006-06-15 11:57:07.000000000 -0700
> --- /tmp/rt 2006-06-27 17:02:16.541296520 -0700
> ***************
> *** 1339,1345 ****
> }
>
> @elts{@elts}=();
> ! return sort {$a<=>$b} keys %elts;
> }
>
> sub get_type_argument {
> --- 1339,1360 ----
> }
>
> @elts{@elts}=();
> ! return sort {
> ! if ($a =~ /^\d+$/) { # $a is numeric ID ...
> ! if ($b =~ /^\d+$/) { # ... and $b is a numeric
> ID,
> ! $a<=>$b; # return digit
> comparison result
> ! }
> ! else { # $a is a numeric
> ID, $b is an object name ...
> ! -1; # order $a before
> $b
> ! }
> ! }
> ! elsif ($b =~ /^\d+$/) { # $a is object name, $b is
> numeric ID ...
> ! 1; # order $b
> before $a
> ! }
> ! else { # $a and $b are
> object names ...
> ! $a cmp $b; # order by string
> value
> ! }
> ! } keys %elts;
> }
>
> sub get_type_argument {
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
> Best Practical is hiring! Come hack Perl for us: http://bestpractical.com/about/jobs.html
>
--
Best regards, Ruslan.
More information about the Rt-devel
mailing list