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

.pagination_optionsObject

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



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

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