The cl-getopt Reference Manual

This is the cl-getopt Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:00:17 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-getopt

CFFI wrapper to the libc getopt_long function

Author

Gary Hollis

License

Public Domain

Defsystem Dependency

cffi-grovel (system).

Dependency

cffi (system).

Source

cl-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 cl-getopt/cl-getopt.asd

Source

cl-getopt.asd.

Parent Component

cl-getopt (system).

ASDF Systems

cl-getopt.


3.1.2 cl-getopt/package.lisp

Source

cl-getopt.asd.

Parent Component

cl-getopt (system).

Packages

cl-getopt.


3.1.3 cl-getopt/grovel.lisp

Dependency

package.lisp (file).

Source

cl-getopt.asd.

Parent Component

cl-getopt (system).


3.1.4 cl-getopt/cl-getopt.lisp

Dependency

grovel.lisp (file).

Source

cl-getopt.asd.

Parent Component

cl-getopt (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-getopt

Source

package.lisp.

Use List
  • cffi.
  • common-lisp.
Public Interface
Internals

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 &key command-arg-present-p)

Returns the values

* option-values
* remaining-arguments

given the list of input arguments and options specification.
option-values is hash-table of the short or long argument name
string (short if present) and the list of all supplied values of that
option in the order they were given. remaining-arguments is a list of
the remaining arguments after processing the options.

Note that if no argument is supplied to an option, whether because the
argspec is :none or :optional, there will still be a list of NIL
elements for each time the option was supplied without an argument.
When the argspec is :required, some kind of value must be in the
argument list for each time that option was supplied.

options should be a list of plists, each plist of the form (&key long
short argspec description) where

* long is a symbol, string or character naming the long argument name.
* short is a symbol, string or character naming the short argument name.
* argspec is one of the values :none, :required, :optional.
* description is a string to be used in an automatically generated argument description message.

command-arg-present-p should be T whenever the argument list includes
the command as the first element, and NIL when it’s not included. For
general scripting use it should be present, but this option is
included to allow easier use of getopt for parsing argument lists
without the command being present.

Package

cl-getopt.

Source

cl-getopt.lisp.

Function: option-descriptions (options &key column-width column-minspace)

Generates a description string for the list of options supplied.

column-width controls the width in characters of each option column. column-minspace controls the minimum space to pad between columns.

Package

cl-getopt.

Source

cl-getopt.lisp.


5.2 Internals


5.2.1 Macros

Macro: with-foreign-args ((argc argv) args &body body)

Converts a Lisp list of strings denoting the arguments supplied to a command into two values:

* argc: number of argument strings
* argv: array of argument strings

These are bound to the symbols supplied in the (argc argv) list.

Package

cl-getopt.

Source

cl-getopt.lisp.

Macro: with-foreign-longopts ((foreign-array long-only-list) options &body body)
Package

cl-getopt.

Source

cl-getopt.lisp.

Macro: with-foreign-shortopts (shortopts-binding options &body body)
Package

cl-getopt.

Source

cl-getopt.lisp.


5.2.2 Ordinary functions

Function: ->optionstr (x)
Package

cl-getopt.

Source

cl-getopt.lisp.

Function: ->shortchar (x)
Package

cl-getopt.

Source

cl-getopt.lisp.

Function: c-getopt-long (argc argv shortopts longopts index)
Package

cl-getopt.

Source

cl-getopt.lisp.

Function: option-shortarg (option)
Package

cl-getopt.

Source

cl-getopt.lisp.

Function: options->shortargs (options)
Package

cl-getopt.

Source

cl-getopt.lisp.

Function: short-char (x)
Package

cl-getopt.

Source

cl-getopt.lisp.


5.2.3 Classes

Class: option
Package

cl-getopt.

Source

cl-getopt.lisp.

Direct superclasses
  • foreign-struct-type.
  • translatable-foreign-type.

Appendix A Indexes


A.1 Concepts


A.3 Variables