From: Martin Mares Date: Sun, 29 Mar 2015 16:24:05 +0000 (+0200) Subject: "bex job -l" lists jobs in a long format, which includes subjects X-Git-Tag: v3.3 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=503e1c6e699c33ee38a1a35782de5f4c2902e93d;p=bex.git "bex job -l" lists jobs in a long format, which includes subjects --- diff --git a/lib/bin/bex-job b/lib/bin/bex-job index 06f0e13..21a8a19 100755 --- a/lib/bin/bex-job +++ b/lib/bin/bex-job @@ -8,14 +8,19 @@ use Getopt::Long; use BEX; my $edit; +my $long; my $queue_name; sub usage() { print <] [] +If a job-id is given, print information on the given job. +Otherwise, list all known jobs. + Options: -e, --edit Run editor on the given job (no locking) +-l, --long When listing jobs, use long format (with subjects) -q, --queue= Act on the given queue AMEN exit 0; @@ -23,6 +28,7 @@ AMEN GetOptions( "e|edit!" => \$edit, + "l|long!" => \$long, "q|queue=s" => \$queue_name, "help" => \&usage, ) && @ARGV <= 1 or die "Try `bex job --help' for more information.\n"; @@ -31,8 +37,16 @@ my $queue = BEX::Queue->new($queue_name); if (!@ARGV) { my @jobs = $queue->all_job_ids; - for (sort @jobs) { - print $_, "\n"; + for my $id (sort @jobs) { + if ($long) { + my $job = $queue->job_metadata($id); + my $has_att = -d $queue->attachment_dir($id); + print $job->name; + print " +ATT" if $has_att; + print "\n"; + } else { + print $id, "\n"; + } } exit 0; }