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

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

## Name

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

## Table Of Contents

## Synopsis

- package require cmdr::validate

## Description

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

boolean

  Completable. Accepts a Tcl boolean.

identity
pass
str

  Infinite. Accepts all strings.

integer

  Infinite. Accepts a Tcl integer number.

double

  Infinite. Accepts a Tcl double number.

percent

  Infinite. Accepts a Tcl double number in the range [0,100].

rdirectory

  Completable. Accepts a readable directory (path).

rfile

  Completable. Accepts a readable file (path).

rpath

  Completable. Accepts a readable path.

rwdirectory

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

rwfile

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

rwpath

  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.

## Keywords

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

Copyright © 2013-2016 Andreas Kupries
Copyright © 2013-2016 Documentation, Andreas Kupries