Class: SchwarmCli::Commands::Base

Inherits:
Thor
  • Object
show all
Defined in:
lib/schwarm_cli/commands/base.rb

Constant Summary collapse

DEFAULT_LIST_LIMIT =
20

Class Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


12
# File 'lib/schwarm_cli/commands/base.rb', line 12

def self.exit_on_failure? = true

.pagination_optionsObject

Declares –limit, –page, –all options for the next method.



17
18
19
20
21
22
# File 'lib/schwarm_cli/commands/base.rb', line 17

def self.pagination_options
  method_option :limit, type: :numeric,
                        desc: "Max results per page (default: #{DEFAULT_LIST_LIMIT})"
  method_option :page, type: :numeric, desc: "Page number (1-indexed)"
  method_option :all, type: :boolean, default: false, desc: "Fetch all pages (no cap)"
end