8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
While going through some of the perl script...
I had found the below line..
use Getopt::Long;
my $GetOptionsReturnCode = GetOptions ( '<>' => sub { push(@unknownArg, @_); }, 'h|help' => sub { &helpMessage(); exit 0; }, );
Could anyone please explain the above one ... (1 Reply)
Discussion started by: scriptscript
1 Replies
2. Programming
Hi All
I am using Getopt::Long in perl and i am trying to have it so if i dont supply a switch after the progname is will do a defult option
i have the following
GetOptions($OPT,
'debug|d',
'mail|m',
) or info();
i want it run the debug if it is not given a switch
... (1 Reply)
Discussion started by: ab52
1 Replies
3. Programming
I am reading arguments passed to a C++ program which accepts long options.
Long options start with '--', with the value joined with the option by an = sign, with no intervening spaces.
An example is as follows:
programName --vdz=15.0
I want to store 'vdz' in variable 'key', whereas... (4 Replies)
Discussion started by: kristinu
4 Replies
4. Programming
My question is simple: When should I use a long, int, char, unsigned/signed variables??
When I declare a variable "unsigned;" what did I do it???
Why would I delcare an integer "long" or "short" ( unsigned or signed)??
Any examples of when things like "unsigned", "long", "short" etc...... (6 Replies)
Discussion started by: cpp_beginner
6 Replies
5. Shell Programming and Scripting
Hi there, I have an example basic script (below) and ive been trying to figure out how to stop multiple arguments to my options occuring. for example using the example script below I can issue two arguments for, say the --surname option and it will not barf at me (although thats what i want it to... (11 Replies)
Discussion started by: rethink
11 Replies
6. Shell Programming and Scripting
Hi ,
I am using getopt for both short and long options as below
SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval set -- "$OPTS"
while ; do
case $1 in
-a|--alpha)
echo "-a or --alpha... (1 Reply)
Discussion started by: padmisri
1 Replies
7. Shell Programming and Scripting
Hi ,
I am using getopt for both short and long options as below
SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval set -- "$OPTS"
while ; do
case $1 in
-a|--alpha)
echo "-a or --alpha... (0 Replies)
Discussion started by: padmisri
0 Replies
8. Shell Programming and Scripting
:)
Can anybody help me about how to use getopt in shell scripting. (3 Replies)
Discussion started by: darshakraut
3 Replies