LavinMQ::Config::CliOpt
Marks a config property as settable from a command-line argument.
Positional arguments (in order):
- short flag with optional value placeholder, e.g.
"-p PORT"(use""when the option has no short flag) - long flag with optional value placeholder, e.g.
"--amqp-port=PORT" - description shown in
--help - optional
Proc(String, T)that converts the raw argument to the property's type. When omitted, the property's own type is used and the value is converted by the matchingConfig#parse_valueoverload.
Named arguments:
section:groups the flag under a heading in--help, one of"options","bindings","tls"or"clustering". Defaults to"options".deprecated:a complete warning message, printed verbatim, when the flag is used. To forward the old value to a replacement, define a setter (and no getter) on the deprecated property; an option with no replacement defines no setter and its value is dropped after the warning.
Parsed by Config#parse_cli. CLI args take precedence over EnvOpt and IniOpt.
@[CliOpt("-p PORT", "--amqp-port=PORT", "AMQP port to listen on (default: 5672)", section: "bindings")]
property amqp_port = 5672
A deprecated flag whose value is forwarded to a replacement: declare the
instance variable (not a property) and define only the setter, which
assigns to the new property.
@[CliOpt("", "--default-password=HASH", "(Deprecated) Hashed password for default user",
section: "options", deprecated: "--default-password is deprecated, use --default-password-hash")]
@default_password : Auth::Password::SHA256Password = DEFAULT_PASSWORD_HASH
def default_password=(value)
@default_password_hash = value # forward to the replacement
end