Class: Oldtime::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/oldtime/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/oldtime/cli.rb', line 17

def initialize(*)
  super
  o = options.dup
  the_shell = (o["no-color"] ? Thor::Shell::Basic.new : shell)
  Oldtime.ui = UI::Shell.new(the_shell)
  Oldtime.ui.debug! if o["verbose"]

  home = Rc.p.home = o["dir"] || Rc.p.home
  homerc = Rc.p.homerc = Pa("#{home}rc")

  Rc << Optimism.require(homerc.absolute2)
end

Instance Method Details

#backup(profile, instance = :default) ⇒ Object

method_option “x”, :aliases => “-x”, :default => “x”, :type => :string, :banner => “NAME”, :desc => “x”



32
33
34
# File 'lib/oldtime/cli.rb', line 32

def backup(profile, instance=:default)
  run(:backup, profile, instance, options.dup)
end

#restore(profile, instance = :default) ⇒ Object



37
38
39
# File 'lib/oldtime/cli.rb', line 37

def restore(profile, instance=:default)
  run(:restore, profile, instance, options.dup)
end