You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cb help
GLOBAL OPTIONS
--exporters=arg - List of exporters to transform the data (default: ["table", "stdout"])
--help - Show this message
--version - Display the program version
The default in the flag help output contains an array: default: ["table", "stdout"]
However, when a user supplies this value they might think they need to supply ["table", "stdout"]
Flag attribute is configured like so: flag [:exporters], desc: "List of exporters to transform the data", default_value: ['table','stdout'], type: Array
However, when a user is supplying the flag they would use --exporters=table,stdout and not --exporters=['table','stdout']
This is confusing for the user. The default_value value should be a real world value that will be processed by the type conversion system of GLI.
default_value: "table,stdout"
The text was updated successfully, but these errors were encountered:
As a workaround I just changed the type to String and processed the incoming value.
flag [:exporters], desc: "List of exporters to transform the data", default_value: 'table,stdout', type: String
I don't know if transforming the data in the pre is abusing this pre block, but I didn't see another way. A transform block on the flag would have been nice to pass in.
pre do |_global, command, options, _args|
options[:exporters] = options[:exporters].split(',')
end
Example:
The default in the flag help output contains an array:
default: ["table", "stdout"]
However, when a user supplies this value they might think they need to supply
["table", "stdout"]
Flag attribute is configured like so:
flag [:exporters], desc: "List of exporters to transform the data", default_value: ['table','stdout'], type: Array
However, when a user is supplying the flag they would use
--exporters=table,stdout
and not--exporters=['table','stdout']
This is confusing for the user. The default_value value should be a real world value that will be processed by the type conversion system of GLI.
default_value: "table,stdout"
The text was updated successfully, but these errors were encountered: