Module: Jets::Thor::SharedOptions::ClassMethods

Defined in:
lib/jets/thor/shared_options.rb

Instance Method Summary collapse

Instance Method Details

#format_option(defaults = {}) ⇒ Object



16
17
18
19
# File 'lib/jets/thor/shared_options.rb', line 16

def format_option(defaults = {})
  default = defaults[:default] || "table"
  option :format, default: default, desc: "Output format: #{CliFormat.formats.join(", ")}"
end

#function_name_option(defaults = {}) ⇒ Object



25
26
27
28
# File 'lib/jets/thor/shared_options.rb', line 25

def function_name_option(defaults = {})
  default = defaults[:default] || "controller"
  option :function, aliases: :n, default: default, desc: "Lambda Function name"
end

#paging_options(defaults = {}) ⇒ Object



6
7
8
9
10
# File 'lib/jets/thor/shared_options.rb', line 6

def paging_options(defaults = {})
  option :limit, default: defaults[:limit] || 25, aliases: :l, type: :numeric, desc: "Per page limit"
  option :order, default: defaults[:order] || "asc", aliases: :o, desc: "Order: asc or desc"
  option :page, aliases: :p, type: :numeric, desc: "Page number"
end

#verbose_optionObject



21
22
23
# File 'lib/jets/thor/shared_options.rb', line 21

def verbose_option
  option :verbose, aliases: :v, default: false, type: :boolean, desc: "Show more verbose logging output. Useful for debugging what's under the hood"
end

#yes_optionObject



12
13
14
# File 'lib/jets/thor/shared_options.rb', line 12

def yes_option
  option :yes, aliases: :y, type: :boolean, desc: "Skip are you sure prompt"
end