mruby wrapper of argtable(3). This containing argtable3's BSD source
C Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib
src
test
.clang-format
.gitignore
.travis.yml
.travis_build_config.rb
LICENSE
LICENSE_argtable3
README.md
Rakefile
build_config.rb
mrbgem.rake
mruby-argtable.gem

README.md

mruby-argtable Build Status

Argtable wrapper

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|
  conf.gem mgem: 'mruby-argtable'
end
  • or add mgem dependency like:
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
  • NOTE: argtable2 library(as application) or dev headers(when you build) are required.
    • Ubuntu/Debian: apt-get install libargtable2-dev
    • RH-ish: yum install argtable-devel

Want to use statically linked version?

  • Specify the branch(and it checks-out and uses argtable3).
conf.gem github: 'udzura/mruby-argtable', branch: 'static-link-argtable3'

example

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

License

under the BSD License(same as argtable itself):

  • See LICENSE file
  • This gem will be bundled with argtable object. See LICENSE_argtable3 for the object.