[ANN] Trollop 1.1 released

W

William Morgan

Trollop version 1.1 has been released!

http://trollop.rubyforge.org

Trollop is YAFCLAP --- yet another fine commandline argument
processing library for Ruby. Trollop is designed to provide the
maximal amount of GNU-style argument processing in the minimum number
of lines of code (for you, the programmer).

Trollop provides a nice automatically-generated help page, robust
option parsing, and sensible defaults for everything you don't
specify.

Synopsis:

###### simple ######

opts = Trollop::eek:ptions do
opt :monkey, "Use monkey mode."
opt :goat, "Use goat model", :default => true
opt :num_limbs, "Set number of limbs", :default => 4
end

p opts

###### complex ######

opts = Trollop::eek:ptions do
version "test 1.2.3 (c) 2007 William Morgan"
banner <<-EOS
Test is an awesome program that does something very, very important.

Usage:
test [options] <filenames>+
where [options] are:
EOS

opt :ignore, "Ignore incorrect values"
opt :file, "Extra data filename to read in, with a very long option description like this one", :type => String
opt :volume, "Volume level", :default => 3.0
opt :iters, "Number of iterations", :default => 5
end
Trollop::die :volume, "must be non-negative" if opts[:volume] < 0
Trollop::die :file, "must exist" unless File.exists?(opts[:file]) if opts[:file]

== REQUIREMENTS:

* none

Changes:

== 1.1 / 2007-01-30
* Trollop::eek:ptions now passes any arguments as block arguments. Since
instance variables are not properly captured by the block, this
makes it slightly less noisy to pass them in as local variables.
(A real-life use for _why's cloaker!)
* Help display now preserves original argument order.
* Trollop::die now also has a single string form in case death is not
due to a single argument.
* Parser#text now an alias for Parser#banner, and can be called
multiple times, with the output being placed in the right position
in the help text.
* Slightly more indicative formatting for parameterized arguments.

http://trollop.rubyforge.org
 
F

Francois Beausoleil

SGVsbG8gV2lsbGlhbSwKCjIwMDcvMS8zMCwgV2lsbGlhbSBNb3JnYW4gPHdtb3JnYW4tcnVieS10
YWxrQG1hc2FuamluLm5ldD46Cj4gPT0gUkVRVUlSRU1FTlRTOgo+Cj4gKiBub25lCgpJIGJlZyB0
byBkaWZmZXI6CiQgZ2VtIGRlcGVuZGVuY3kgdHJvbGxvcApHZW0gdHJvbGxvcC0xLjEKICBob2Ug
KD49IDEuMS43KQoKJCBnZW0gZGVwZW5kZW5jeSBob2UKR2VtIGhvZS0xLjEuNwogIHJ1Ynlmb3Jn
ZSAoPj0gMC40LjApCiAgcmFrZSAoPj0gMC43LjEpCgpTbyBpbiBlZmZlY3QsIFRyb2xsb3AgZGVw
ZW5kcyBvbiBIb2UgYW5kIFJ1Ynlmb3JnZS4gIERvIHlvdSBrbm93IGFueQp3YXkgdG8gbm90IGRl
cGVuZCBvbiBob2UgPyAgSSB3b3VsZCBsaWtlIHRvIGZpbmQgb3V0LCBzbyBJIGNhbiB1c2UKVHJv
bGxvcCBpbiBQaXN0b24gYW5kIG5vdCBib3RoZXIgd2l0aCBIb2UuCgpNeSB1bmRlcnN0YW5kaW5n
IGlzIHRoYXQgSG9lIGFsbG93cyB5b3UgdG8gZ2VuZXJhdGUgZ2Vtcy4gIElzIGl0IHN0aWxsCnVz
ZWZ1bCBhZnRlciB0aGUgaW5pdGlhbCBnZW5lcmF0aW9uID8KClRoYW5rcyAhCi0tIApGcmFuw6dv
aXMgQmVhdXNvbGVpbApodHRwOi8vYmxvZy50ZWtzb2wuaW5mby8KaHR0cDovL3Bpc3Rvbi5ydWJ5
Zm9yZ2Uub3JnLwo=
 
R

Ryan Davis

So in effect, Trollop depends on Hoe and Rubyforge. Do you know any
way to not depend on hoe ? I would like to find out, so I can use
Trollop in Piston and not bother with Hoe.

Can we NOT start with this again??
 
F

Francois Beausoleil

SGksCgoyMDA3LzEvMzEsIFJ5YW4gRGF2aXMgPHJ5YW5kLXJ1YnlAemVuc3BpZGVyLmNvbT46Cj4g
Q2FuIHdlIE5PVCBzdGFydCB3aXRoIHRoaXMgYWdhaW4/PwoKSSBhbSAqc28qIHNvcnJ5LiAgVGhp
bmtpbmcgYmFjaywgSSBkbyByZW1lbWJlciBzZWVpbmcgbWVzc2FnZXMgdG8gdGhhdCBlZmZlY3Qu
CgpJIGZvcmdvdCB0byBjaGVjayB0aGUgYXJjaGl2ZXMuCgpUaGFua3MgZm9yIHJlbWluZGluZyBt
ZS4KCkJ5ZSAhCi0tIApGcmFuw6dvaXMgQmVhdXNvbGVpbApodHRwOi8vYmxvZy50ZWtzb2wuaW5m
by8KaHR0cDovL3Bpc3Rvbi5ydWJ5Zm9yZ2Uub3JnLwo=
 
W

William Morgan

Excerpts from Francois Beausoleil's message of Wed Jan 31 08:04:24 -0800 2007:
I am *so* sorry. Thinking back, I do remember seeing messages to that
effect.

Thanks for bringing this up. I was unaware of the issue.

I've released version 1.2, which has no dependency on hoe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top