Changeset d768767 for client/bin/gbrm


Ignore:
Timestamp:
Jul 5, 2010, 9:04:02 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
master, debian, mac, no-cups, web
Children:
0d02eca
Parents:
b58aada
git-author:
Jessica B. Hamrick <jhamrick@…> (07/05/10 21:04:02)
git-committer:
Jessica B. Hamrick <jhamrick@…> (07/05/10 21:04:02)
Message:

Add 'last' keyword for gbrm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/bin/gbrm

    rb58aada rd768767  
    4141if ($id eq "all") {
    4242    foreach $id(@jobs) {
    43         $printer->cancelJob($id);
     43        cancel_job($id, $printer);
    4444    }
    4545}
    4646elsif ($id eq "current") {
    4747    $id = $jobs[0];
    48     $printer->cancelJob($id);
     48    cancel_job($id, $printer);
     49}
     50elsif ($id eq "last") {
     51    $id = $jobs[-1];
     52    cancel_job($id, $printer);
    4953}
    5054else {
     55    cancel_job($id, $printer);
     56}
     57
     58sub cancel_job {
     59    my ($id, $printer) = @_;
     60    my $job_ref = $printer->getJob($id);
     61    my $title = $job_ref->{'title'};
    5162    $printer->cancelJob($id);
     63
     64    print "Canceled job '$title' (id $id)\n";
    5265}
Note: See TracChangeset for help on using the changeset viewer.