Changeset a81397c for client/bin/gbrm


Ignore:
Timestamp:
Jul 5, 2010, 5:05:46 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
master, debian, mac, no-cups, web
Children:
38388ac
Parents:
c5a98db
git-author:
Jessica B. Hamrick <jhamrick@…> (07/05/10 17:05:46)
git-committer:
Jessica B. Hamrick <jhamrick@…> (07/05/10 17:05:46)
Message:

Added the "current" option to gbrm, which just removes the current job from the queue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/bin/gbrm

    rc5a98db ra81397c  
    55use strict;
    66use warnings;
     7
     8use Net::CUPS;
     9use Net::CUPS::Destination;
    710
    811my $usage = "Usage: gbq QUEUE ID\n";
     
    3639    @args = ("cancel", "-a", "$queue");
    3740}
     41elsif ($id eq "current") {
     42    my $cups = Net::CUPS->new();
     43    $cups->setServer("$host");
     44    my $printer = $cups->getDestination("$queue");
     45    my @jobs = $printer->getJobs(0, 0);
     46    my $id = $jobs[0];
     47    @args = ("cancel", "$id", "$queue");
     48}
    3849else {
    3950    @args = ("cancel", "$id", "$queue");
Note: See TracChangeset for help on using the changeset viewer.