module Cli
Defined in:
cli.crConstant Summary
-
VERSION =
{{ (`shards version /srv/crystaldoc.info/github-ralsina-markterm-v0.12.0/src`).chomp.stringify }}
Class Method Summary
-
.config_path(app_name : String) : String
Default config file path for a tool, e.g.
-
.option_flag(value : Docopt::OptionValue | Nil) : Bool
Interpret an option as a boolean flag.
-
.option_list(value : Docopt::OptionValue | Nil) : Array(String)
docopt returns a String when a repeatable option occurs once, and an Array(String) when it repeats (on the command line or through a list in the config file); normalize to an Array(String) either way.
-
.option_string(value : Docopt::OptionValue | Nil, fallback : String) : String
Same, for options that carry a docopt [default: ...] and must not end up nil: fall back to the documented default.
-
.option_string(value : Docopt::OptionValue | Nil) : String | Nil
docopt-config returns config file values with their YAML types, so an option documented as taking a string can come back as an Int32 (e.g.
-
.read_source(source : String) : String
Read the input file, or standard input when the file is "-"
Class Method Detail
Default config file path for a tool, e.g. ~/.config/markterm/config.yml (or $XDG_CONFIG_HOME/markterm/config.yml)
Interpret an option as a boolean flag. docopt gives true for a flag given on the command line, false or nil otherwise; the config file can set true or false; environment variables are always strings, so "1", "true" or "yes" mean on, anything else off.
docopt returns a String when a repeatable option occurs once, and an Array(String) when it repeats (on the command line or through a list in the config file); normalize to an Array(String) either way.
Same, for options that carry a docopt [default: ...] and must not end up nil: fall back to the documented default.
docopt-config returns config file values with their YAML types, so an option documented as taking a string can come back as an Int32 (e.g. "margin: 20" or a numeric docopt default). Normalize those to the String docopt would have produced, ignoring values of other types.
Read the input file, or standard input when the file is "-"