module Bashly::Script::Introspection::Arguments
Public Instance Methods
Source
# File lib/bashly/script/introspection/arguments.rb, line 6 def args return [] unless options['args'] options['args'].map do |options| Argument.new options end end
Returns an array of Arguments
Source
# File lib/bashly/script/introspection/arguments.rb, line 15 def default_args args.select(&:default) end
Returns an array of all the default Args
Source
# File lib/bashly/script/introspection/arguments.rb, line 20 def repeatable_arg_exist? args.any?(&:repeatable) end
Returns true if one of the args is repeatable
Source
# File lib/bashly/script/introspection/arguments.rb, line 25 def required_args args.select(&:required) end
Returns an array of all the required Arguments
Source
# File lib/bashly/script/introspection/arguments.rb, line 30 def usage_string_args args.map(&:usage_string) end
Returns an array of args usage_string for the command’s usage_string
Source
# File lib/bashly/script/introspection/arguments.rb, line 35 def whitelisted_args args.select(&:allowed) end
Returns an array of all the args with a whitelist