You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use your library to parse my ARGV. I didn't find the way to manage the case of having a argument with a message, such as:
myscript.rb -m "my smart release note"
Is there a way to cover this case with µ-optparse?
If no, I see in code your lib is a wrapper to OptionParser which has #separator and #record_separator attributes. Maybe there is a way to access to it ?
The text was updated successfully, but these errors were encountered:
Currently this is not possible with micro-optparse. At the moment I have no time to investigate how to accomplish that in general and even if it would be possible, it depends on the number of lines to add for this functionality. If it is 'too much', a fork with more features would be the best solution.
If you want to experiment a little bit by yourself go ahead and tell me what you found or make a branch so I can see the changes. Otherwise I will have more time in around 4 weeks, I will dig into it then by myself.
I was wrong - arguments with spaces in them are supported. Just define an option which takes a String as an argument and you are ready to go.
Example Script:
require 'rubygems' # necessary for ruby v1.8.*
require 'micro-optparse'
options = Parser.new do |p|
p.option :sentence, "Files which will be processed", :default => ""
end.process!
p options
Example Usage:
ruby temp.rb -s 'Hello World! You can even, if you want to, use commas.'
=> {:sentence=>"Hello World! You can even, if you want to, use commas."}
PS: Sorry for my late response. Was fun digging into OptionParser again and even more fun that µ-optparse is more powerful than I thought. I hope this answers your question, if not, feel free to ask. :)
Hi,
I use your library to parse my ARGV. I didn't find the way to manage the case of having a argument with a message, such as:
myscript.rb -m "my smart release note"
Is there a way to cover this case with µ-optparse?
If no, I see in code your lib is a wrapper to OptionParser which has #separator and #record_separator attributes. Maybe there is a way to access to it ?
The text was updated successfully, but these errors were encountered: