4.1.2.4 Built-In Valued Options

Clon currently defines 6 built-in valued option types. These option types may change the default value for some common properties, and / or provide additional properties of their own. All of this is described below.

stropt

This option type is for options taking strings as their argument. String options don’t provide any additional properties, but their default argument name is changed from "ARG" to "STR".

lispobj

This option type is for options taking any kind of Lisp object as their argument. lispobj options change their default argument name from "ARG" to "OBJ". Also, they provide an additional property called :typespec which must be a Common Lisp type specifier that the argument must satisfy. It defaults to t. Look at the --clon-line-width built-in option for an example.

enum

This option type is for options taking values from an enumerated set of keywords. enum options change their default argument name from "ARG" to "TYPE". Also, they provide an additional property called :enum to store the list of Common Lisp keywords enumerating the possible values. The end-user does not use a colon when providing an argument to an enum option. Only the keyword’s name. The end-user also has the ability to abbreviate the possible values. An empty argument is considered as an abbreviation for the first element in the set. Look at the --clon-version built-in option for an example.

path

This option type is for options taking a colon-separated list of pathnames as argument. path options change their default argument name from "ARG" to "PATH". Also, they provide an additional property called :type which specifies the kind of path which is expected. Possible values are: :file, :directory, :file-list, :directory-list or nil (meaning that anything is allowed). Null paths are allowed, and may be provided by an empty argument. Look at the --clon-search-path and --clon-theme built-in options for examples.

switch

This option type is for Boolean options. switch options change their default argument type from required to optional and provide a fallback value of t automatically for optional arguments. switch options provide a new property called :argument-style. Possible values are :yes/no (the default), :on/off, :true/false, :yup/nope, :yeah/nah. This property affects the way the argument name and true or false values are advertized in help strings. However, all possible arguments forms (see Switches in The Clon End-User Manual) are always available to all switches.

xswitch

This option type stands for extended switch. Extended switches result from the mating of a male switch and a female enumeration, or the other way around (elementary decency prevents me from describing this mating process in detail): their possible values are either Boolean or from an :enum property as in the case of enum options. As simple switches, xswitch options change their default argument type from required to optional and provide a fallback value of t automatically for optional arguments. They also provide the :argument-style property. Contrary to switches, however, this property does not affect the argument name. It only affects the way true or false values are displayed in help strings. Look at the --clon-highlight built-in option for an example.