The getopt Reference Manual

This is the getopt Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:35:32 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 getopt

Maintainer

Kevin M. Rosenberg <>

Author

Kevin Rosenberg <>

License

BSD

Version

1.0

Source

getopt.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 getopt/getopt.asd

Source

getopt.asd.

Parent Component

getopt (system).

ASDF Systems

getopt.

Packages

getopt-system.


3.1.2 getopt/package.lisp

Source

getopt.asd.

Parent Component

getopt (system).

Packages

getopt.


3.1.3 getopt/main.lisp

Dependency

package.lisp (file).

Source

getopt.asd.

Parent Component

getopt (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 getopt

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

4.2 getopt-system

Source

getopt.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: getopt (args options)

Processes a list of arguments and options. Returns filtered argument list and alist of options.
opts is a list of option lists. The fields of the list are
- NAME name of the long option
- HAS-ARG with legal values of :NONE, :REQUIRED, :OPTIONAL
- VAL value to return for a option with no arguments

Package

getopt.

Source

main.lisp.

Function: match-unique-abbreviation (abbr strings)

Returns position of ABBR in STRINGS. ABBR may be a unique abbreviation. Returns NIL if no match found.

Package

getopt.

Source

main.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: analyze-arg (arg)

Analyzes an argument. Returns option-type,base-name,argument

Package

getopt.

Source

main.lisp.

Function: decompose-arg (arg option-type)

Returns base-name,argument

Package

getopt.

Source

main.lisp.

Function: find-option (name options)

Find an option in option list. Handles using unique abbreviations

Package

getopt.

Source

main.lisp.

Function: is-long-option (arg)
Package

getopt.

Source

main.lisp.

Function: is-option-terminator (arg)
Package

getopt.

Source

main.lisp.

Function: is-short-option (arg)
Package

getopt.

Source

main.lisp.

Function: match-option (arg options)

Matches an argument to an option. Returns option-list,option-type,base-name,argument

Package

getopt.

Source

main.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables