futhark-0.11.0: An optimising compiler for a functional, array-oriented language.

Futhark.CodeGen.Backends.GenericC.Options

Description

This module defines a generator for getopt_long based command line argument parsing. Each option is associated with arbitrary C code that will perform side effects, usually by setting some global variables.

Synopsis

# Documentation

data Option Source #

Specification if a single command line option. The option must have a long name, and may also have a short name.

In the action, the option argument (if any) is stored as in the char*-typed variable optarg.

Constructors

 Option Fields

Whether an option accepts an argument.

Constructors

 NoArgument RequiredArgument String The String becomes part of the help text. OptionalArgument

Generate an option parser as a function of the given name, that accepts the given command line options. The result is a function that should be called with argc and argv. The function returns the number of argv elements that have been processed.

If option parsing fails for any reason, the entire process will terminate with error code 1.