Changeset fc8707b for client/bin/gbrm


Ignore:
Timestamp:
Oct 2, 2010, 9:20:02 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
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)
Message:
Add '-hhelp' flags to all the client scripts
Add a '-ddryrun' option to gbr, to just list what would be done instead of doing it
File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/bin/gbrm

    r6b7441a rfc8707b  
    1111use Getopt::Long;
    1212
    13 my $usage = "Usage: gbq [-q QUEUE] ID\n";
     13# usage
     14my $usage = <<USAGE;
     15Usage: gbq [options] [-q QUEUE] ID
     16
     17        -q, --queue             Specify a queue other than the default
     18        -h, --help              Print this message
     19USAGE
     20
     21# initialize the variables for the options
    1422my $q = "";
    15 GetOptions ('q|queue=s' => \$q);
     23my $help = 0;
     24
     25# parse the options
     26GetOptions ('q|queue=s' => \$q,
     27            'h|help', => \$help);
     28
     29# if the -h flag was passed, then print the usage and exit
     30if ($help) {
     31    print $usage;
     32    exit 0;
     33}
    1634
    1735my @ids = @ARGV[0 .. $#ARGV];
     
    1937# if the -q option is not specified, then assume we're using the
    2038# default queue
    21 if (!$q){
     39if (!$q) {
    2240    $q = "DEFAULT";
    2341}
Note: See TracChangeset for help on using the changeset viewer.