Last active
August 27, 2017 16:50
-
-
Save picatz/c3fd25c55a4b898ddf818347f4342f27 to your computer and use it in GitHub Desktop.
Command Lion -- Hello World Expanded
This file contains hidden or 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 'command_lion' | |
CommandLion::App.run do | |
name "Hello There!" | |
version "1.0.0" | |
description "A more complex 'hello' application!" | |
command :hello do | |
flag "hello" | |
type :strings | |
default "world" | |
description "Say hello to something! ( default: #{default} )" | |
action do | |
options[:count].argument.times do | |
puts "Hello #{argument}!" | |
end | |
end | |
option :count do | |
description "Change how many times you say hello." | |
flag "count" | |
type :integer | |
default 1 | |
action do | |
abort "Must be a positive integer greater than or equal to 1" unless argument >= 1 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment