module Cult::CLI::CommandDSLExtensions
Public Instance Methods
none()
click to toggle source
Lets us say run(arguments: none)
# File lib/cult/cli/cri_extensions.rb, line 122 def none 0 end
optional_project()
click to toggle source
# File lib/cult/cli/cri_extensions.rb, line 108 def optional_project @command.project_required = false end
run(arguments: nil, &block)
click to toggle source
This allows an explicit number of arguments to be passed to run, and halts with an error otherwise
Calls superclass method
# File lib/cult/cli/cri_extensions.rb, line 128 def run(arguments: nil, &block) @command.argument_spec = arguments if arguments super(&block) end
unlimited()
click to toggle source
Lets us say run(arguments: 1 .. unlimited) instead of
run(arguments: 1 .. Float::INFINITY)
or just outright:
run(arguments: unlimited)
# File lib/cult/cli/cri_extensions.rb, line 117 def unlimited Float::INFINITY end