#! /usr/bin/perl
use warnings;
use strict;
use integer;
use FindBin;
use lib $FindBin::RealBin;
use Def;

# This script doesn't do anything but take options and arguments from
# the command line, so it's not very useful to run it.  However, if you
# are writing a new Perl helper script, this makes a pretty good
# template to start it with.

our $usage = <<END;
usage: $0 [-h] [argument]...
    -h print this usage message
END

# Read command-line arguments and options.
my @opt;
my @arg;
{
  my $stopopt = '';
  for ( @ARGV ) {
    if    ( $stopopt  ) { push @arg, $_        }
    elsif ( $_ eq '-' ) { $stopopt = '1'       }
    else  { push @{ /^-/ ? \@opt : \@arg }, $_ }
  }
}
my %opt = map { my @o = split ''; shift @o; map {$_=>1} @o; } @opt;
if ( $opt{'?'} || $opt{h} ) { print $usage; exit 0; }

# List the options and arguments.
print "Options  : "; print "[$_] " for sort keys %opt; print "\n";
print "Arguments: "; print "[$_] " for           @arg; print "\n";

