# This file is licensed to you under the license specified in the included file
# `LICENSE'. Look there for further details.


# gengetopt sample file.
#
# Execute: `./gengetopt < sample'
#
# gengetopt takes from standard input this file and write to standard output
# a main.c file.

# Standard input format:
#
# This file consist in lines of sentences with the following format:
#
#         package <packname>
#         version <version>
#         option <long> <short> <desc> <argtype> <required>
#         option <long> <short> <desc> no
#         option <long> <short> <desc> flag      <onoff>
#         ... # ...
#
# Where:
#
# <packname> = Double quoted string with upper and lower case chars, digits,
#              '-' and '.'.  No spaces allowed.
# <version>  = Double quoted string with upper and lower case chars, digits,
#              '-' and '.'.  No spaces allowed.
# <long>     = Double quoted string with upper and lower case chars, digits,
#              '-' and '.'.  No spaces allowed.
# <short>    = A single upper or lower case char, or a digit.
# <desc>     = String with upper and lower case chars, digits, '-', '.' and
#              spaces. First character must be no space.
# <argtype>  = string, int, short, long, float, double, longdouble or longlong.
# <required> = yes or no.
# <onoff>    = on or off.
# Comments begins with '#' in any place of the line and ends in the end of line.


# Name of your program
package "gengetopt-sample"       # don't use package if you're using automake
# Version of your program
version "1.0.1"                  # don't use version if you're using automake

# Options
option  "str-opt"         s "A string option"      string     no
option  "int-opt"         i "A int option"         int        yes
option  "short-opt"       S "A short option"       short      no
option  "long-opt"        l "A long option"        long       yes
option  "float-opt"       f "A float option"       float      no
option  "double-opt"      d "A double option"      double     no
option  "long-double-opt" L "A long double option" longdouble no
option  "long-long-opt"   y "A long long option"   longlong   no

option  "func-opt"        F "A function option"    no 
# This option is usefull when you want an option to call an arbitrary function.
# It must not be required (otherwise, why is an option if it doesn't take
# parameter?)

option  "flag-opt"        x "A flag option"        flag       off
# This option turn on or off a flag, last column is the state of the flag when
# program start. If user specify it, flag toggles.
 

# COMMENTS
#
# gengetopt follows the trandition fo the UNIX tools, and recieve the options
# from the standar input and writes the generated code to the standar output,
# printing any error message in the standar error.
#
# Long options names can't be the same in two different options. The same
# apply to short options.
#
# Options created by default: `--verbose' ('-V') and `--help' ('h'). If the
# long or short options are the same than yours, just redefine yours and
# change all in the generated code.
#
# The name of the vars generated where to store arguments are long options
# canonized. It means, '.' and '-' are both changed by '_'. And '_arg' are
# appended, or '_flag' if they are a flag.
#
# gengetopt doesn't guess if `long double' and `long long' types really
# exists in the system. That is your responsability, you can use `autoconf'
# for that task.
#
# If you use `autoconf' with the generated output, you should check for
# `getopt_long' function, if not found define `HAVE_GETOPT_LONG' and include
# `getopt.o' and `getopt1.o' in the compiled and linked objects. In any case,
# you should copy `getopt.c', `getopt1.c' and `getopt.h' files in your 
# proyect.
#
# If you use `automake' with the generated output, you don't need to use
# the sentences `package' and `version' in the input.
#
# If you used an option than takes an string, a function named
# `gengetopt_strdup' is generated and used into the code. If you prefere to
# use the more standard `strdup' function, erase `gengetopt_strdup' function,
# change calls to `strdup' and add `#include <string.h>' in the top.
#
# The output that `gengetopt' program generate is not under any license.
# You can do whatever you want with the output and distribute it under the
# license that you want. But you should note that `getopt.c', `getopt1.c'
# and `getopt.h' files itself are licensed under the
# `GNU GENERAL PUBLIC LICENSE' (`GPL'), so if you use that files your proyect
# must be licensed under a `GPL' compatible license.
#
# `gengetopt' source code and included files are licensed to you under the
# license specified in the included file `LICENSE'.
#
# Indentation of the generated code is not the best. It uses tabs for
# indentation, and it should look readable in 80 columns screens. You can
# use `indent' program to reindent the output. May be you want to improve this,
# look `TODO' file.

