-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo test --nocapture
no longer works after docopts landing
#296
Comments
cc @BurntSushi, would you know if this is a bug in docopt or does the specification for |
Hmm. Trying to understand here. Should the behavior of |
Ah yes, sorry for the lack of context! Here's the docopt for
Namely when you execute So to answer your question, yes, I'm wondering if it's possible to have |
Unfortunately, I don't think so. Fundamentally, the only thing that can match an Even when this bug is fixed, |
One idea to make the usage clearer would be to couple the
This would mean that the following would be invalid invocations, but it would be specified more clearly by the usage string (i.e., you can't have an
|
Hm that is a bit unfortunate. cc @wycats, any opinions on this? |
I probably miss a lot of context here. I don't even know Rust, but here you go. Docopt's option
I assume that the second problem is the one you are trying to solve? Here's how it is normally solved: Let's say you want to implement
In this case all the things after The problem is that your usage says
Now if you run {'--help': False,
'<args>': ['--option'],
'test': True} (Assuming However, I'm not sure what you expect in case of Also, note, that to do P.S. "I'm sorry I wrote you such a long letter; I didn't have time to write a short one." |
@halst, thanks for the response! In case you're interested, here's a bit of background about cargo. Cargo is structured like The main
The You've noticed that Now to explain what So all-in-all, this is in theory what I was expecting:
I think the concept I have in my head is that flags to That may have been a bit rambly, but does that make sense? Thanks again for responding! |
That totally makes sense. But the notion of "any unknown flags are passed as
So the only problem is handling options to Manually inspecting the args produced by This seems quite possible. I don't see any apparent flaws. Anyway, you should be careful. You might end up with "collisions" of |
That also makes sense, thanks @halst! I'll noodle on this and see what I can come up with. |
@alexcrichton do we have a good solution for this? If not, I am sad 😦 |
Sadly I don't think I do know of a great solution to this without jumping through many hoops, but the fear being almost unable to add new options in the future does seem like a real worry to me, and with docopt it's at least consistent. That being said, it would still be nice to have a solution to this... |
For now I'm going to close this as working as intended. Currently we have a very consistent interface for all of the cargo-related tools, and in the future we may want to apply some of the tricks previously mentioned in this issue. I am quite worried by how solving this would severely limit us in adding future options to |
The help command sorta explains this if you think about it (and know) the meaning of
--
as you can do this and it will work just finecargo test -- --nocapture
but this is less then obvious. Not sure what a sane way to bridge test runner CLI options would be but it would be nice to have them listed in thecargo help test
command so it's more obvious how to pass these flags.The text was updated successfully, but these errors were encountered: