RevBank::Type
Argument types for declarative RevBank commands
Description
A type tells a parameter of a declared command how to parse a word, what to say when that fails, and what to offer for tab completion. A parameter can override each of these with its own keys. See RevBank::Plugins for how declarations use these.
The types are functions, exported by RevBank::Global.
An eager type rejects a word while it is being typed, as soon as the word can no
longer become valid. See eager in "Parameter keys" in RevBank::Plugins.
Types
User
A user account, parsed with parse_user, so the value is the canonical
account name. Completes to the names of user accounts, including * accounts
both with and without the *. Eager.
Amount
A positive amount, parsed with parse_amount, so the value is a
RevBank::Amount, and a sum like 21+21 is accepted. Zero is rejected. The
amount completes to itself, so 21+21 becomes 42.00. Eager.
Text
Any non-empty word.
Description
Like Text, but rejects a word that is a username or an amount.
Enum($values)
One of the keys of the hash $values, which may also be a coderef that
receives the arguments gathered so far and returns the hash. Completes to the
keys. Eager.
Author
Juerd Waalboer #####@juerd.nl