I have a simple watir (web-driver) script which goes to google. But, I want to use option parser to set an argument in the cmd to select a browser. Below is my script:
I\'m trying to write a documentation for my project in Sphinx and whenever Sphinx encounters OptionParser in my module it gives me:
Given the following code: options = {} optparse = OptionParser.new do |opts| opts.on(\'-t\', \'--thing [THING1,THING2]\', Array, \'Set THING1, THING2\') do |t|
The following \"parser.add_option\" statements work but if the script is run without 开发者_C百科an option/arg it will not complain. If an option/argument are not specified I would like it to display
I was trying out optparse and this is my initial script. #!/usr/bin/env python import os, sys from optparse import OptionParser
Using OptionParser for string argument input and hash assignment.What is the best way to read-in multiple variables for a single argument?How do I then assign those to a hash to reference?Here is what
I\'d like to be able to use ruby\'s OptionParser to parse sub-commands of the form COMMAND [GLOBAL FLAGS] [SUB-COMMAND [SUB-C开发者_Go百科OMMAND FLAGS]]
In OptionParser I can make an option mandatory, but if I leave out that value it will take the name of any following option as the value, screwing up the rest of the command line parsing.
I don\'t know ruby very well, but I\'m trying to add some functionality to this script a co-worker wrote.