-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop_on_unknown doesn't work #17
Comments
@Student Any tests/examples showing how you would like it to work? |
I'll see what I can come up with. |
@Student Is ignore_invalid_options the you are searching for? I don’t know what stop_on_unknown() was for, it seems to be readonly on public API anyway, IMHO at least should be renamed. |
Sorry, I've been sick. (Still am.) Suppose we have something like this: opt :a, :name => 'a', :type => :int
opt :b, :name => 'b', :type => :int And an args string:
With stop_on_unknown, we should have a return As for my use case, consider the following: I have a tool which operates in several different modes. The enactment of any particular mode is complex enough that it might be necessary to debug it. So I might define the I want stop_on_unknown. |
cat bad_stop.rb: require 'trollop'
opts = Trollop::options do
opt :alpha, "The biggest, most important opt"
stop_on_unknown
end ~/work/trollop ruby bad_stop.rb --beta
Error: unknown argument '--beta'.
Try --help for help. This looks like a fail somewhere... |
@Student thanks - I'll look at this once the tests start passing again. Something odd happening in the heads |
Explicit raises are now inside the block. The entire mechanism seems to have been neglected, as it's application is uneven.
The text was updated successfully, but these errors were encountered: