Class: Wavesync::CLI
- Inherits:
-
Object
- Object
- Wavesync::CLI
- Defined in:
- lib/wavesync/cli.rb
Class Method Summary collapse
-
.start ⇒ Object
: () -> void.
Class Method Details
.start ⇒ Object
: () -> void
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/wavesync/cli.rb', line 9 def self.start command_name = ARGV.first && !ARGV.first.start_with?('-') ? ARGV.shift : 'sync' command_class = Commands::ALL.find { |cmd| command_name == cmd.name } if command_class command_class.new.run else puts "Unknown command: #{command_name}" puts "Available commands: #{Commands::ALL.map(&:name).join(', ')}" exit 1 end end |