Class: Synco::Command::Top
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Synco::Command::Top
- Defined in:
- lib/synco/command.rb
Instance Method Summary collapse
Instance Method Details
#chdir(&block) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/synco/command.rb', line 43 def chdir(&block) if root = @options[:root] Dir.chdir(root, &block) else yield end end |
#invoke(program_name: File.basename($0)) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/synco/command.rb', line 58 def invoke(program_name: File.basename($0)) if @options[:version] puts "synco v#{Synco::VERSION}" elsif @options[:help] or @command.nil? print_usage(program_name) else chdir do @command.invoke(self) end end end |