Changeset fc8707b
- Timestamp:
- Oct 2, 2010, 9:20:02 PM (14 years ago)
- Branches:
- master, debian, mac, no-cups
- Children:
- a5cf43b
- Parents:
- 6b7441a
- git-author:
- Jessica B. Hamrick <jhamrick@…> (10/02/10 21:20:02)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (10/02/10 21:20:02)
- Location:
- client/bin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
client/bin/gbq
r6b7441a rfc8707b 11 11 use Getopt::Long; 12 12 13 my $usage = "Usage: gbq [-q QUEUE]\n"; 13 # usage 14 my $usage = <<USAGE; 15 Usage: gbq [options] [-q QUEUE] 14 16 17 -q, --queue Specify a queue other than the default 18 -h, --help Print this message 19 USAGE 20 21 # initialize the variables for the options 15 22 my $q = ""; 16 GetOptions ('q|queue=s' => \$q); 23 my $help = 0; 24 25 # parse the options 26 GetOptions ('q|queue=s' => \$q, 27 'h|help' => \$help); 28 29 # if the -h flag was passed, then print the usage and exit 30 if ($help) { 31 print $usage; 32 exit 0; 33 } 17 34 18 35 # if the -q option is not specified, then assume we're using the -
client/bin/gbr
r6b7441a rfc8707b 12 12 use Image::ExifTool qw(ImageInfo); 13 13 14 my $usage = "Usage: gbr QUEUE FILES\n"; 14 # the usage for this script 15 my $usage = <<USAGE; 16 Usage: gbr [options] [-q QUEUE] FILES 15 17 18 -q, --queue Specify a queue other than the default 19 -d, --dryrun Just list what would be done 20 -h, --help Print this message 21 USAGE 22 23 # initialize the variables for the options 16 24 my $q = ""; 17 GetOptions ('q|queue=s' => \$q); 25 my $dryrun = 0; 26 my $help = 0; 27 28 # parse the options 29 GetOptions ('q|queue=s' => \$q, 30 'd|dryrun' => \$dryrun, 31 'h|help' => \$help); 32 33 # if the -h flag was passed, then print the usage and exit 34 if ($help) { 35 print $usage; 36 exit 0; 37 } 18 38 19 39 my @files = @ARGV[0 .. $#ARGV]; … … 61 81 # if $printer is not defined, then throw an error 62 82 unless( $printer){ 63 print "Cannot access queue $q... do you have network connectivity and permission to view the queue?\n";83 print "Cannot access queue $q... do you have network connectivity and permission to view the queue?\n"; 64 84 exit 1; 65 85 } … … 100 120 } 101 121 102 # send the print job, given the file and the job title 103 $jobid = $printer->printFile($file, $title); 104 105 # if the printFile command returned a job id, then print that out 106 # for the user to see 107 if ($jobid) { 108 print "Sent job '$title' (id $jobid)\n"; 109 } 122 # unless it's a dry run, send the print job, given the file and 123 # the job title 124 unless ($dryrun) { 125 $jobid = $printer->printFile($file, $title); 110 126 111 # otherwise, let them know that an error occurred 112 else { 113 print "Error sending job '$title'\n"; 114 } 127 # if the printFile command returned a job id, then print that out 128 # for the user to see 129 if ($jobid) { 130 print "Sent job '$title' (id $jobid)\n"; 131 } 132 133 # otherwise, let them know that an error occurred 134 else { 135 print "Error sending job '$title'\n"; 136 } 137 138 # otherwise, just print what we would do 139 } else { 140 print "Would send file '$file' with title '$title'\n"; 141 } 115 142 } -
client/bin/gbrm
r6b7441a rfc8707b 11 11 use Getopt::Long; 12 12 13 my $usage = "Usage: gbq [-q QUEUE] ID\n"; 13 # usage 14 my $usage = <<USAGE; 15 Usage: gbq [options] [-q QUEUE] ID 16 17 -q, --queue Specify a queue other than the default 18 -h, --help Print this message 19 USAGE 20 21 # initialize the variables for the options 14 22 my $q = ""; 15 GetOptions ('q|queue=s' => \$q); 23 my $help = 0; 24 25 # parse the options 26 GetOptions ('q|queue=s' => \$q, 27 'h|help', => \$help); 28 29 # if the -h flag was passed, then print the usage and exit 30 if ($help) { 31 print $usage; 32 exit 0; 33 } 16 34 17 35 my @ids = @ARGV[0 .. $#ARGV]; … … 19 37 # if the -q option is not specified, then assume we're using the 20 38 # default queue 21 if (!$q) {39 if (!$q) { 22 40 $q = "DEFAULT"; 23 41 } -
client/bin/gutenbach-client-config
r6b7441a rfc8707b 10 10 # the usage for the program 11 11 my $usage = <<USAGE; 12 Usage: gutenbach-client-config [ -l|--list|-a|--add|-d|--delete] [QUEUE] [--host=HOST]12 Usage: gutenbach-client-config [options] 13 13 14 14 -l, --list List available queues … … 16 16 -d, --delete QUEUE Delete a queue 17 17 -s, --set-default QUEUE Set the default queue 18 -h, --host HOST Hostname for the queue 18 -h, --host HOST Hostname for the queue (must be used with -a) 19 -H, --help Print this message 19 20 USAGE 20 21 … … 25 26 my $host = ""; 26 27 my $default = ""; 28 my $help = 0; 27 29 28 30 # get the options from the command line … … 31 33 'a|add=s' => \$add, 32 34 'd|delete=s' => \$delete, 33 'h|host=s' => \$host); 35 'h|host=s' => \$host, 36 'H|help' => \$help); 37 38 # if the -H flag was passed, then print the usage and exit 39 if ($help) { 40 print $usage; 41 exit 0; 42 } 34 43 35 44 # set the path where the configuration files live
Note: See TracChangeset
for help on using the changeset viewer.