Module: GitCommander::CommandLoaderOptions

Included in:
Command
Defined in:
lib/git_commander/command_loader_options.rb

Overview

Establishes values to be set by loaders

Instance Method Summary collapse

Instance Method Details

#argument(arg_name, options = {}) ⇒ Object



18
19
20
# File 'lib/git_commander/command_loader_options.rb', line 18

def argument(arg_name, options = {})
  add_option :argument, options.merge(name: arg_name)
end

#description(value = nil) ⇒ Object



12
13
14
15
16
# File 'lib/git_commander/command_loader_options.rb', line 12

def description(value = nil)
  return @description = value if value

  @description
end

#flag(flag_name, options = {}) ⇒ Object



22
23
24
# File 'lib/git_commander/command_loader_options.rb', line 22

def flag(flag_name, options = {})
  add_option :flag, options.merge(name: flag_name)
end

#on_run(&on_run) ⇒ Object



30
31
32
# File 'lib/git_commander/command_loader_options.rb', line 30

def on_run(&on_run)
  @block = on_run
end

#summary(value = nil) ⇒ Object



6
7
8
9
10
# File 'lib/git_commander/command_loader_options.rb', line 6

def summary(value = nil)
  return @summary = value if value

  @summary
end

#switch(switch_name, options = {}) ⇒ Object



26
27
28
# File 'lib/git_commander/command_loader_options.rb', line 26

def switch(switch_name, options = {})
  add_option :switch, options.merge(name: switch_name)
end