#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
# Copyright 1997-2001 by Open Source Development Network. See README
# and COPYING for more information, or see http://slashcode.com/.
# $Id: command-line,v 1.1.2.1 2001/03/29 17:28:49 pudge Exp $

use strict;
use File::Basename;
use FindBin '$Bin';
use Getopt::Std;
# more modules

(my $VERSION) = ' $Revision: 1.1.2.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
my $PROGNAME = basename($0);
(my $PREFIX = $Bin) =~ s|/[^/]+/?$||;

my %opts;
# Remember to doublecheck these match usage()!
usage('Options used incorrectly') unless getopts('hvu:', \%opts);
usage() if ($opts{'h'} || !keys %opts);
version() if $opts{'v'};
$opts{'u'} ||= 'slash';

# more usage() checks here

# main program logic (in braces to offset nicely)
{

}

# subroutines

sub usage {
	print "*** $_[0]\n" if $_[0];
	# Remember to doublecheck these match getopts()!
	print <<EOT;

Usage: $PROGNAME [OPTIONS] ... [FILES]

SHORT PROGRAM DESCRIPTION

Main options:
	-h	Help (this message)
	-v	Version
	-u	Virtual user (default is "slash")
	-N	Description (make this as many lines as you need,
		just line it up)
	-O	Don't put in extra newlines in a single section
		of options, only between sections of options

Other options:
	-P	Wheeeee
	-Q	Note there are no periods ending the description lines,
		unless there is more than one sentence.  For multiple
		sentences in a single description, please do use
		periods.

EOT
	exit;
}

sub version {
	print <<EOT;

$PROGNAME $VERSION

This code is a part of Slash, and is released under the GPL.
Copyright 1997-2001 by Open Source Development Network. See README
and COPYING for more information, or see http://slashcode.com/.

EOT
	exit;
}

__END__
