module Bashly::Script::Introspection::Arguments

Public Instance Methods

args() click to toggle source

Returns an array of Arguments

# 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
default_args() click to toggle source

Returns an array of all the default Args

# File lib/bashly/script/introspection/arguments.rb, line 15
def default_args
  args.select(&:default)
end
repeatable_arg_exist?() click to toggle source

Returns true if one of the args is repeatable

# File lib/bashly/script/introspection/arguments.rb, line 20
def repeatable_arg_exist?
  args.any?(&:repeatable)
end
required_args() click to toggle source

Returns an array of all the required Arguments

# File lib/bashly/script/introspection/arguments.rb, line 25
def required_args
  args.select(&:required)
end
usage_string_args() click to toggle source

Returns an array of args usage_string for the command's usage_string

# File lib/bashly/script/introspection/arguments.rb, line 30
def usage_string_args
  args.map(&:usage_string)
end
whitelisted_args() click to toggle source

Returns an array of all the args with a whitelist

# File lib/bashly/script/introspection/arguments.rb, line 35
def whitelisted_args
  args.select(&:allowed)
end