Sha256: d7cfcc3fe62bc5303c7e66db4bcba109d0f46029a2628a8bd8a7bfe03922c96a
Contents?: true
Size: 1.21 KB
Versions: 18
Compression:
Stored size: 1.21 KB
Contents
Trollop FAQ ----------- Q: Why should I use Trollop? A: Because it will take you FEWER LINES OF CODE to do reasonable option parsing than any other option parser in existence. Look: opts = Trollop::options do opt :monkey, "Use monkey mode" opt :goat, "Use goat mode", :default => true opt :num_limbs, "Set number of limbs", :default => 4 end That's it. And opts is a hash and you do whatever you want with it. Trivial. You don't have to mix option processing code blocks with the declarations. You don't have to make a class for every option (what is this, Java?). You don't have to write more than 1 line of code per option. Q: Why is it called "Trollop"? A: No reason. Q: Why does Trollop disallow numeric short argument names, like '-1' and '-9'? A: Because it's ambiguous whether these are arguments or negative integer or floating-point parameters to arguments. E.g., what about "-f -3". Is that a negative three parameter to -f, or two separate parameters? I could be very clever and detect when there are no arguments that require floating-point parameters, and allow such short option names in those cases, but opted for simplicity and consistency.
Version data entries
18 entries across 18 versions & 4 rubygems