Class: BibSync::Command
- Inherits:
-
Object
- Object
- BibSync::Command
- Defined in:
- lib/bibsync/command.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Command
Returns a new instance of Command.
6 7 8 9 |
# File 'lib/bibsync/command.rb', line 6 def initialize(args) @args = args @options = {} end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bibsync/command.rb', line 11 def run @opts = OptionParser.new(&method(:set_opts)) @opts.parse!(@args) process exit 0 rescue Exception => ex raise ex if Log.trace || SystemExit === ex $stderr.print "#{ex.class}: " if ex.class != RuntimeError $stderr.puts ex. $stderr.puts ' Use --trace for backtrace.' exit 1 end |