#!/usr/bin/env runawk

#use "alt_getopt.awk"

BEGIN {
	long_opts ["verbose"] = "v"
	long_opts ["help"]    = "h"
	long_opts ["fake"]    = ""
	long_opts ["len"]     = takes_arg
	long_opts ["output"]  = "o"

	while (getopt("hVvo:n:")){
		if (optopt == "h"){
			print "option `h'"
		}else if (optopt == "V"){
			print "option `V'"
		}else if (optopt == "v"){
			print "option `v'"
		}else if (optopt == "o"){
			print "option `o':", optarg
		}else if (optopt == "n"){
			print "option `n':", optarg
		}else if (optopt == "fake"){
			print "option `fake'"
		}else if (optopt == "len"){
			print "option `len':", optarg
		}else{
			abort()
		}
		fflush()
	}

	for (i=1; i < ARGC; ++i){
		if (ARGV [i] != "")
			printf "ARGV [%s] = %s\n", i, ARGV [i]
	}

	exit 0
}
