Class: Utopia::Command::Top

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/utopia/command.rb

Instance Method Summary collapse

Instance Method Details

#invoke(program_name: File.basename($0)) ⇒ Object



327
328
329
330
331
332
333
334
335
336
337
# File 'lib/utopia/command.rb', line 327

def invoke(program_name: File.basename($0))
  if @options[:version]
    puts "utopia v#{VERSION}"
  elsif @options[:help] or @command.nil?
    print_usage(program_name)
  else
    track_time do
      @command.invoke(self)
    end
  end
end

#rootObject



323
324
325
# File 'lib/utopia/command.rb', line 323

def root
  File.expand_path(@options.fetch(:root, ''), Dir.getwd)
end