Closed gerrywastaken closed 4 years ago
require "admiral" class Main < Admiral::Command define_flag bloop : Array(String), default: [] of String, required: false def run puts flags.bloop end end Main.run
> bin/cli_test Flag required: --bloop
Am I doing something wrong?
Actually this seems a bit odd. The default must be nil or not a boolean? https://github.com/jwaldrip/admiral.cr/blob/master/src/admiral/command/flag.cr#L288
nil
boolean
edit: There also seems to be a related issue here where the type specification is change to type | nil unless the type is set to required: https://github.com/jwaldrip/admiral.cr/blob/master/src/admiral/command/flag.cr#L321
type | nil
So even when the first issue is fixed, the type of bloop is Array(String) | Nil instead of the requested Array(String)
Array(String) | Nil
Array(String)
Am I doing something wrong?
Actually this seems a bit odd. The default must be
nil
or not aboolean
? https://github.com/jwaldrip/admiral.cr/blob/master/src/admiral/command/flag.cr#L288edit: There also seems to be a related issue here where the type specification is change to
type | nil
unless the type is set to required: https://github.com/jwaldrip/admiral.cr/blob/master/src/admiral/command/flag.cr#L321So even when the first issue is fixed, the type of bloop is
Array(String) | Nil
instead of the requestedArray(String)