Skip to content

Instantly share code, notes, and snippets.

@picatz
Last active August 27, 2017 16:50
Show Gist options
  • Save picatz/c3fd25c55a4b898ddf818347f4342f27 to your computer and use it in GitHub Desktop.
Save picatz/c3fd25c55a4b898ddf818347f4342f27 to your computer and use it in GitHub Desktop.
Command Lion -- Hello World Expanded
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