cmdr::validate - Cmdr - Standard validation types for parameters
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.
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.
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.
Use identity if a generate callback is specified.
Use boolean if no default is specified and the parameter is an option.
Use identity if no default is specified and the parameter is an input.
Use boolean if the specified default value is a Tcl boolean.
Use integer if the specified default value is a Tcl integer.
Use identity as fallback of last resort.
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
Copyright © 2013 Andreas Kupries
Copyright © 2013 Documentation, Andreas Kupries