Closed DeflateAwning closed 3 months ago
Generally, the examples are written to be viewed from rustdoc. For example, see https://docs.rs/clap/latest/clap/#example for the discussion on demo.rs
If you want to bypass that, to understand examples, you need to look at the context of the Cargo.toml
. See
https://github.com/clap-rs/clap/blob/9d14f394ba22f65f8957310a03ae5fd613f89d76/Cargo.toml#L117-L119
As this is working as expected and people do have a path forward, I'm going to go ahead and close this. If there is a reason for us to reconsider, let us know!
Could you please consider adding a README to that folder which directs people to the docs appropriately?
Ah I do remember reading that, and didn't get the impression that the examples weren't meant to function in isolation.
Perhaps a message along the lines of the following would be beneficial:
These examples are not meant to function in isolation, and are only suplemental material to the following tutorial(s):
Please complete the following tasks
Rust Version
rustc 1.77.0 (aedd173a2 2024-03-17)
Clap Version
clap = "4.5.4"
Minimal reproducible code
Copied directly from: https://github.com/clap-rs/clap/blob/9d14f394ba22f65f8957310a03ae5fd613f89d76/examples/demo.rs
Steps to reproduce the bug with the above code
Run the code.
Actual Behaviour
It has a bunch of compile errors.
Expected Behaviour
I'd expect a file named
demo.rs
to work in isolation.Additional Context
Disclaimer: I don't really know what I'm doing. I'm sure someone who knew what they were doing would have more success than I am.
Debug Output
No response