1 package CXGN
::Garbage
::cmdline_args
;
5 my ($validopt_ref, $argv_ref) = @_;
9 print "No command line options\n";
13 while(@
{$argv_ref}>0) {
14 $option = shift @
{$argv_ref};
16 if (! defined($validopt_ref->{$option})) {
17 print STDERR
"Unknown option $option\n";
22 if ($validopt_ref->{$option}->[1]) {
23 # Option which requires argument, shift in the next argument from
25 ${$validopt_ref->{$option}->[0]} = shift @
{$argv_ref};
27 # Boolean flag: invert default value
28 if (${$validopt_ref->{$option}->[0]}) {
29 ${$validopt_ref->{$option}->[0]} = 0;
31 ${$validopt_ref->{$option}->[0]} = 1;