6.1.3 Functions

Function: cmdline ()

Get the current application’s command-line.
This command-line is not supposed to contain any Lisp implementation specific option; only user-level ones. When a standalone executable is dumped, this is always the case. When used interactively, this depends on the underlying Lisp implementation. See appendix A.5 of the user manual for more information.

Package

net.didierverna.clon

Source

util.lisp (file)

Function: cmdline-options-p &key CONTEXT

Return T if CONTEXT has any unprocessed options left.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: cmdline-p &key CONTEXT

Return T if CONTEXT has anything on its command-line.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: configuration KEY

Return KEY’s value in the current Clon configuration.

Package

net.didierverna.clon.setup

Source

configuration.lisp (file)

Function: configure KEY VALUE

Set KEY to VALUE in the current Clon configuration.

Package

net.didierverna.clon.setup

Source

configuration.lisp (file)

Function: executablep ()

Return T if the current Lisp image is a standalone executable.
This function detects executables dumped by ASDF’s program-op operation, those dumped by Clon’s ‘dump’ function (which see), and those in which ‘*executablep*’ (which see) has been set to T manually.

Package

net.didierverna.clon

Source

util.lisp (file)

Function: exit &optional STATUS

Quit the current application with STATUS.
This function is considered deprecated. Please use UIOP:QUIT instead.

Package

net.didierverna.clon

Source

util.lisp (file)

Function: getopt &rest KEYS &key CONTEXT SHORT-NAME LONG-NAME OPTION

Get an option’s value in CONTEXT.
The option can be specified either by SHORT-NAME, LONG-NAME, or directly via an OPTION object.
Return two values:
- the retrieved value,
- the value’s source.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: getopt-cmdline &key CONTEXT

Get the next command-line option in CONTEXT.
When there is no next command-line option, return nil. Otherwise, return four values:
- the option object,
- the option’s name used on the command-line,
- the retrieved value,
- the value source.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: help &key CONTEXT ITEM OUTPUT-STREAM SEARCH-PATH THEME LINE-WIDTH HIGHLIGHT

Print CONTEXT’s help.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: make-context &rest KEYS &key SYNOPSIS CMDLINE PROGNAME MAKE-CURRENT

Make a new context.
- SYNOPSIS is the program synopsis to use in that context.
It defaults to *SYNOPSIS*.
- CMDLINE is the argument list (strings) to process.
It defaults to a POSIX conformant argv.
- PROGNAME is an alternate value for argv[0].
It defaults to NIL, in which case the actual argv[0] is used. Otherwise, it can be a non-empty string, standing for itself,
or :environment meaning to retrieve the value of the __CL_ARGV0 environment variable (ignored if it’s empty).
value.
- If MAKE-CURRENT, make the new context current. This is the default.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: make-enum &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-NAME ARGUMENT-TYPE ENUM ENV-VAR FALLBACK-VALUE DEFAULT-VALUE HIDDEN

Make a new enum option.
- SHORT-NAME is the option’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the option’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the option’s description appearing in help strings.
It defaults to nil.
- ARGUMENT-NAME is the option’s argument name appearing in help strings. - ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENUM is the set of possible values.
- ENV-VAR is the option’s associated environment variable.
It defaults to nil.
- FALLBACK-VALUE is the option’s fallback value (for missing optional arguments), if any.
- DEFAULT-VALUE is the option’s default value, if any.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

enum.lisp (file)

Function: make-flag &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ENV-VAR HIDDEN

Make a new flag.
- SHORT-NAME is the option’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the option’s long name (without the double-dash). It defaults to nil.
- DESCRIPTION is the option’s description appearing in help strings. It defaults to nil.
- ENV-VAR is the flag’s associated environment variable.
It defaults to nil.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

flag.lisp (file)

Function: make-group &rest KEYS &key HEADER ITEM HIDDEN

Make a new group.

Package

net.didierverna.clon

Source

group.lisp (file)

Function: make-lispobj &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-NAME ARGUMENT-TYPE ENV-VAR TYPESPEC FALLBACK-VALUE DEFAULT-VALUE HIDDEN

Make a new lispobj option.
- SHORT-NAME is the option’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the option’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the option’s description appearing in help strings.
It defaults to nil.
- ARGUMENT-NAME is the option’s argument name appearing in help strings. - ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENV-VAR is the option’s associated environment variable.
It defaults to nil.
- TYPESPEC is a type specifier the option’s value should satisfy.
- FALLBACK-VALUE is the option’s fallback value (for missing optional arguments), if any.
- DEFAULT-VALUE is the option’s default value, if any.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

lispobj.lisp (file)

Function: make-path &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-NAME ARGUMENT-TYPE ENV-VAR FALLBACK-VALUE DEFAULT-VALUE TYPE HIDDEN

Make a new path option.
- SHORT-NAME is the option’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the option’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the option’s description appearing in help strings.
It defaults to nil.
- ARGUMENT-NAME is the option’s argument name appearing in help strings. - ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENV-VAR is the option’s associated environment variable.
It defaults to nil.
- FALLBACK-VALUE is the option’s fallback value (for missing optional arguments), if any.
- DEFAULT-VALUE is the option’s default value, if any.
- TYPE is the pathname type. It can be one of :file, :directory, :file-list, :directory-list or nil meaning that everything is allowed.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

path.lisp (file)

Function: make-stropt &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-NAME ARGUMENT-TYPE ENV-VAR FALLBACK-VALUE DEFAULT-VALUE HIDDEN

Make a new string option.
- SHORT-NAME is the option’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the option’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the option’s description appearing in help strings.
It defaults to nil.
- ARGUMENT-NAME is the option’s argument name appearing in help strings. - ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENV-VAR is the option’s associated environment variable.
It defaults to nil.
- FALLBACK-VALUE is the option’s fallback value (for missing optional arguments), if any.
- DEFAULT-VALUE is the option’s default value, if any.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

stropt.lisp (file)

Function: make-switch &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-STYLE ARGUMENT-TYPE ENV-VAR DEFAULT-VALUE HIDDEN

Make a new switch.
- SHORT-NAME is the switch’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the switch’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the switch’s description appearing in help strings.
It defaults to nil.
- ARGUMENT-STYLE is the switch’s argument display style. It can be one of :yes/no, :on/off, :true/false, :yup/nope or :yeah/nah.
It defaults to :yes/no.
- ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENV-VAR is the switch’s associated environment variable.
It defaults to nil.
- DEFAULT-VALUE is the switch’s default value, if any.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

switch.lisp (file)

Function: make-synopsis &rest KEYS &key POSTFIX ITEM MAKE-DEFAULT

Make a new SYNOPSIS.
- POSTFIX is a string to append to the program synopsis, in case it accepts a remainder.
- If MAKE-DEFAULT, make the new synopsis the default one.

Package

net.didierverna.clon

Source

synopsis.lisp (file)

Function: make-text &rest KEYS &key CONTENTS HIDDEN

Make a new text.
- CONTENTS is the actual text to display.
- When HIDDEN, the text doesn’t appear in help strings.

Package

net.didierverna.clon

Source

text.lisp (file)

Function: make-xswitch &rest KEYS &key SHORT-NAME LONG-NAME DESCRIPTION ARGUMENT-NAME ARGUMENT-TYPE ENUM ENV-VAR DEFAULT-VALUE HIDDEN

Make a new xswitch.
- SHORT-NAME is the xswitch’s short name (without the dash).
It defaults to nil.
- LONG-NAME is the xswitch’s long name (without the double-dash).
It defaults to nil.
- DESCRIPTION is the xswitch’s description appearing in help strings. It defaults to nil.
- ARGUMENT-NAME is the option’s argument name appearing in help strings. - ARGUMENT-TYPE is one of :required, :mandatory or :optional (:required and :mandatory are synonyms).
It defaults to :optional.
- ENUM is the set of possible non-boolean values.
- ENV-VAR is the xswitch’s associated environment variable.
It defaults to nil.
- DEFAULT-VALUE is the xswitch’s default value, if any.
- When HIDDEN, the option doesn’t appear in help strings.

Package

net.didierverna.clon

Source

xswitch.lisp (file)

Function: nickname-package &optional NICKNAME

Add NICKNAME (:CLON by default) to the :NET.DIDIERVERNA.CLON package.

Package

net.didierverna.clon

Source

package.lisp (file)

Function: progname &key CONTEXT

Return CONTEXT’s program name.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: remainder &key CONTEXT

Return CONTEXT’s remainder.

Package

net.didierverna.clon

Source

context.lisp (file)

Function: setup-termio ()

Autodetect termio support.
Update Clon configuration and *FEATURES* accordingly.

Package

net.didierverna.clon.setup

Source

termio.lisp (file)

Function: version &optional TYPE

Return the current version of Clon.
TYPE can be one of :number, :short or :long.

A version number is computed as major*10000 + minor*100 + patchlevel, leaving two digits for each level. Alpha, beta and rc status are ignored in version numbers.

A short version is something like 1.3{a,b,rc}4, or 1.3.4 for patchlevel. Alpha, beta or rc levels start at 1. Patchlevels start at 0 but are ignored in the output, so that 1.3.0 appears as just 1.3.

A long version is something like
1.3 {alpha,beta,release candidate,patchlevel} 4 "Michael Brecker". As for the short version, a patchlevel of 0 is ignored in the output.

Package

net.didierverna.clon.setup

Source

version.lisp (file)