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

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


cmdr::validate - Cmdr - Standard validation types for parameters

Table Of Contents


  • package require cmdr::validate


Welcome to the Cmdr project, written by Andreas Kupries.

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

Validation types are Cmdr's answer to the necessity of moving between the string and internal representations of cmdr::parameter instances.

This internal package implements the twelve standard validation types shown below. The validate command of the parameter declaration DSL can use these by name. Non-standard types have to provide a proper command prefix instead.

Readers interested in writing their own custom validation types should read Cmdr - Writing custom validation types.

Standard Types


Completable. Accepts a Tcl boolean.


Infinite. Accepts all strings.


Infinite. Accepts a Tcl integer.


Completable. Accepts a readable directory (path).


Completable. Accepts a readable file (path).


Completable. Accepts a readable path.


Completable. Accepts a read/writable directory (path).


Completable. Accepts a read/writable file (path).


Completable. Accepts a read/writable path.

Standard Selection Rules

Because of the aformentioned necessity all parameters must have a validation type assigned to them, and the framework will choose which, if the user did not. This choice is made per the six rules below and always returns one of the builtins described here.

  1. Use identity if a generate callback is specified.

  2. Use boolean if no default is specified and the parameter is an option.

  3. Use identity if no default is specified and the parameter is an input.

  4. Use boolean if the specified default value is a Tcl boolean.

  5. Use integer if the specified default value is a Tcl integer.

  6. Use identity as fallback of last resort.

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