#!/usr/bin/perl # $HeadURL$ $LastChangedRevision$ # Modules use lib substr(`miniade --dirname`,0,-1); use MINIADE; # Configurable stuff # Other globals my($qaz, $wsx); sub main { # Defaults for options $qaz = 0; $wsx = undef; # Process options sub special_opts_handler { #global qaz, wsx if ($ARGV[0] eq '--qaz') { $qaz = 1; # This is a bad option: it's multichar but wants a *separate* argument (i.e. not with '=') } elsif ($ARGV[0] eq '--wsx') { if ($#ARGV+1 < 2) { return 1; } $wsx = $ARGV[1]; shift @ARGV; } else { return 1; } return 0; } MINIADE::process_options(\&special_opts_handler, \&help); # Process arguments MINIADE::bad_usage() if ($#ARGV+1 != 0); # Sanity checks and derivations # Guts MINIADE::info('running ...'); MINIADE::debug(10, 'this is a debug message'); printf "qaz=%s\n", defined $qaz ? $qaz : "undef"; printf "wsx=%s\n", defined $wsx ? $wsx : "undef"; } sub help { my($progname); $progname = MINIADE::get_progname(); print "Usage: $progname [ ] [ --qaz ] [ --wsx ]\n"; exit 0; } main();