class Tabular::Habit
inherits Reference
#
A class that manages the formation of
a set of Tablets
within the block
of Tabular.form
.
Methods#
#argument(choices : Array(String), help = "", directives : Directable | Nil = nil)
#
Create a Argument
-flavoured Tablet
.
- choices: A set of possible values for the argument. If
empty?
, any value is accepted. - help: See
Tablet#help
. - directives: See
Directive
.
#argument(*choice, help = "", directives : Directable | Nil = nil)
#
Create a Argument
-flavoured Tablet
.
- choice: Any number of possible values for the argument. If
empty?
, any value is accepted. - help: See
Tablet#help
. - directives: See
Directive
.
#command(name : String, aliases = [] of String, help = "", directives : Directable | Nil = nil)
#
Create a Command
-flavoured Tablet
.
- name: See
Tablet#name
. - aliases: See
Tablet#aliases
. - help: See
Tablet#help
. - directives: See
Directive
.
#delimiters(value : String)
#
Specify the global string of characters that may delimit an Option
-falvour
Tablet
.
Tabular.form do
# Allows for something like `--option=`
delimiters "="
# Allows for something like `-option:`
delimiters ":"
# Allows for all of the above
delimiters ":="
end
#delimiters : String
#
View source
#directives(kind : Kind, value : Directable)
#
View source
#directives(kind : Kind) : Directive
#
View source
#option(name : String, *aliases : String, help = "", directives : Directable | Nil = nil, delimiters = Tabular.delimiters)
#
Create a Option
-flavoured Tablet
.
- name: See
Tablet#name
. - aliases: See
Tablet#aliases
. - help: See
Tablet#help
. - directives: See
Directive
. - delimiters: Ad hoc delimiters that will override [
Tabular.delimiters
][].
#option(name : String, *aliases, help = "", delimiters = Tabular
#
Create a Option
-flavoured Tablet
with expected
Argument
-flavoured Tablet
(s).
option "--opt" do
argument "arg1_choice1", "arg1_choice2", "arg1_choice3"
argument "arg2_choice1", "arg2_choice2"
end
- name: See
Tablet#name
. - aliases: See
Tablet#aliases
. - help: See
Tablet#help
. - delimiters: Ad hoc delimiters that will override [
Tabular.delimiters
][].