mruby wrapper of argtable(3). This containing argtable3's BSD source
BSD-3-CLAUSE License
Argtable wrapper
build_config.rb
MRuby::Build.new do |conf|
conf.gem mgem: 'mruby-argtable'
end
MRuby::Gem::Specification.new('your-cli') do |spec|
spec.bins = ["your-cli"]
spec.add_dependency 'mruby-argtable', mgem: 'mruby-argtable'
#...
end
# This pattern is useful for mruby-cli bundle
argtable2
library(as application) or dev headers(when you build) are required.
apt-get install libargtable2-dev
yum install argtable-devel
conf.gem github: 'udzura/mruby-argtable', branch: 'static-link-argtable3'
t = Argtable.new
t.literal("v", "verbose", "You are verbose")
t.integer("c", "count", "<c>", "My count")
t.double("s", "seconds", "<t>", "My seconds")
t.string("n", "name", "<n>", "My name")
t.parse(["prog", "-c", "9999", "--verbose", "--name=udzura", "-s", "12.25"])
t["v"].count #=> 1, no value
t["c"].value #=> 9999
t["n"].value #=> "udzura"
t["s"].value #=> 12.25
t.glossary
# -v, --verbose You are verbose
# -c, --count=<c> My count
# -s, --seconds=<t> My seconds
# -n, --name=<n> My name
under the BSD License(same as argtable itself):