misconfiguration has asked for the wisdom of the Perl Monks concerning the following question:
Any help at all would be greatly appreciated!$VERSION = 0.01; $uname = "uname"; # Set ARGS if (@ARGV < 1) { die "usage: $0 \n -a <queuename> -- Add a queue\n -r <queuename> -- Remove a queue\n -s <queuename> -- Check queue/spooler status\n -f <queuename> -- Force option\n -h print this help file\n"; }
First of all, thanks for all of the help everyone has provided. I do in fact have another question; since this program needs to be a bit intuitive. My initial thought process behind this program would be:#!/usr/bin/perl -w use strict; use Getopt::Long; my ($add,$remove,$status,$force); my %add_opts; GetOptions ( \%add_opts, 'queue=s', 'label=s' ); sub display_help { die "Usage: -a <queuename> -- Add a queue\n -r <queuename> -- Remove a queue\n -s <queuename> -- Check queue/spooler status\n -f <queuename> -- Force option\n -v Version Information\n -h print this help file\n"; } GetOptions ( version => sub{ print "This is mkpq Version 0.01\n"; exit +; } ); GetOptions ( help => \&display_help ); if ($add_opts {'queue'}) { print "Test\n"; } else { print &display_help; }
}if (a) { # switch to add a queue do system($somecmd $q); #run system cmd with entered string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Questions about adding arguements to a program.
by toolic (Bishop) on Dec 10, 2007 at 20:56 UTC | |
|
Re: Questions about adding arguements to a program.
by tuxz0r (Pilgrim) on Dec 10, 2007 at 20:57 UTC | |
|
Re: Questions about adding arguements to a program.
by dwm042 (Priest) on Dec 10, 2007 at 21:36 UTC | |
|
Re: Questions about adding arguements to a program.
by naChoZ (Curate) on Dec 10, 2007 at 21:04 UTC | |
|
Re: Questions about adding arguments to a program.
by Roy Johnson (Monsignor) on Dec 10, 2007 at 20:53 UTC | |
|
Re: Questions about adding arguements to a program.
by ian (Beadle) on Dec 11, 2007 at 08:51 UTC |