Class: RubyEdit::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ruby_edit/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#configureObject



27
28
29
30
31
32
33
34
# File 'lib/ruby_edit/cli.rb', line 27

def configure(*)
  if options[:help]
    invoke :help, ['configure']
  else
    require_relative 'commands/configure'
    RubyEdit::Commands::Configure.new(options).execute
  end
end

#editObject



42
43
44
45
46
47
48
49
50
51
# File 'lib/ruby_edit/cli.rb', line 42

def edit(*)
  if options[:help]
    invoke :help, ['edit']
  elsif options.empty?
    invoke :help
  else
    require_relative 'commands/edit'
    RubyEdit::Commands::Edit.new(options).execute
  end
end

#versionObject



15
16
17
18
# File 'lib/ruby_edit/cli.rb', line 15

def version
  require_relative 'version'
  puts "v#{RubyEdit::VERSION}"
end