This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "thor" | |
class MyCLI < Thor | |
desc "hello NAME", "say hello to NAME" | |
option :from | |
def hello(name) | |
puts "from: #{options[:from]}" if options[:from] | |
puts "Hello #{name}" | |
end | |
end | |
MyCLI.start(ARGV) | |
# ruby ./cli.rb hello kotopoulo | |
# ruby ./cli hello Yehuda --from "Carl Lerche" |
No comments:
Post a Comment