Class: Agen::BaseOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/agen/base_options.rb

Direct Known Subclasses

BashOptions, ZshOptions

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BaseOptions

Returns a new instance of BaseOptions.



5
6
7
# File 'lib/agen/base_options.rb', line 5

def initialize(options)
  @options = options
end

Instance Method Details

#set_histfileObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/agen/base_options.rb', line 9

def set_histfile
  # handle not set here
  if !defined?(self.class::HISTFILE)
    puts "Please specify shell history file with -h option. See agen --help."
    return false
  end

  options.tap do |opts|
    opts[:histfile] = self.class::HISTFILE
  end
end

#set_rcfileObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/agen/base_options.rb', line 21

def set_rcfile
  if !defined?(self.class::RCFILE)
    puts "Please specify shell rc file with -r option. See agen --help."
    return false
  end

  options.tap do |opts|
    opts[:rcfile] = self.class::RCFILE
  end
end