Changeset a81397c for client


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.

Location:
client/bin
Files:
2 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");
  • client/bin/gbrm.1

    r2c76f34 ra81397c  
    44.SH SYNOPSIS
    55.B gbrm
    6 \fIQUEUE\fR [all|\fIID\fR]
     6\fIQUEUE\fR [all|current|\fIID\fR]
    77.SH DESCRIPTION
    88Removes a single job from a Gutenbach queue, given the job id, which
     
    1111command.  If
    1212.B all
    13 is used in place of an id, then all jobs are removed from the queue.
    14 The queue must have previously been added with
     13is used in place of an id, then all jobs are removed from the queue.  If
     14.B current
     15is used in place of an id, then the current (top) job is removed from
     16the queue.  The queue must have previously been added with
    1517.B gutenbach-client-config
    1618so that gbrm knows which host to use.
Note: See TracChangeset for help on using the changeset viewer.