[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]

cmdr::validate::common(n) 1.0 doc "Cmdr, a framework for command line parsing and dispatch"


cmdr::validate::common - Cmdr - Utilities for Validation Types

Table Of Contents



Welcome to the Cmdr project, written by Andreas Kupries.

For availability please read Cmdr - How To Get The Sources.

This package publicly exports three commands for use in the implementation of validation types. The standard validation types defined in package cmdr::validate make use of these commands.


::cmdr::validate::common fail p code type x

When invoked this command throws an error indicating a validation type failure. The arguments provide the information used to construct both error message and code.

cmdr::parameter p

The cmdr::parameter instance whose validation failed. The error message will contain this parameter's type and label (flag in case of an option).

list code

A list providing additional elements for the error code, detailing the internal name of the validation type triggering the error.

string type

A string providing the human-readable name of the validation type triggering the error.

string x

The string value failing the validation.

::cmdr::validate::common complete-enum choices nocase buffer

When invoked this command returns a list of strings containing just the elements of choices the value of buffer is a prefix of. When nocase is set the command will ignore letter case and treat the string in buffer as all-lowercase.

list choices

The list of values which can complete the data in buffer.

boolean nocase

A boolean flag specifying if the completion is done ignoring letter-case (true), or not (false)).

string buffer

The string to complete via the list of choices.

::cmdr::validate::common complete-glob filter buffer

When invoked this command returns a list of strings, the paths in the filesystem the value of buffer is a prefix of, and not rejected by the filter command (prefix).

Note that when the value of buffer is a relative path the current working directory is used to locate matches.

cmd-prefix filter

A command prefix taking a single argument, the candidate path, and returning a boolean value indicating (non-)acceptance of the path. A result of true accepts the candidate, false rejects it.

string buffer

The string, a partial path, to complete.

Bugs, Ideas, Feedback

Both the package(s) and this documentation will undoubtedly contain bugs and other problems. Please report such at Cmdr Tickets.

Please also report any ideas you may have for enhancements of either package(s) and/or documentation.


arguments, command hierarchy, command line completion, command line handling, command tree, editing command line, help for command line, hierarchy of commands, interactive command shell, optional arguments, options, parameters, processing command line, tree of commands