Sha256: 089ae53c1ff419437d1d9fb07403e75169db36276598db77fc86b4e62b55590c
Contents?: true
Size: 646 Bytes
Versions: 1
Compression:
Stored size: 646 Bytes
Contents
#!/usr/bin/env ruby require 'bundler/inline' gemfile do source 'https://rubygems.org' gem "simple-cli", '~> 0.2', path: "../../.." end module Ex1; end module Ex1::CLI include Simple::CLI # Command without arguments # # Example: # # ./ex1 hello:world # def hello_world puts "Hello from #{__FILE__}" end # Command with arguments # # This implements a command with arguments # # Examples: # # ./ex1 hello --name=user "what's up" # def hello(message, name: nil) if name puts "Hello #{name}: #{message}!" else puts "Hello, #{message}!" end end end Ex1::CLI.run!(*ARGV)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple-cli-0.2.28 | doc/examples/ex1/ex1.rb |