scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
220 stars 46 forks source link

Version Information #29

Closed jlpoolen closed 2 years ago

jlpoolen commented 2 years ago

It would be helpful to have a self-publishing of the version running.

jlpoole@taurus /usr/local/src/retina $ cargo run --example client 
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/examples/client`
retina 0.2.0

USAGE:
    client <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help        Prints this message or the help of the given subcommand(s)
    metadata    
    mp4         
jlpoole@taurus /usr/local/src/retina $ cargo run --example client -V
error: Found argument '-V' which wasn't expected, or isn't valid in this context

USAGE:
    cargo run --example <NAME>...

For more information try --help
jlpoole@taurus /usr/local/src/retina $ cargo run --example client --version
error: Found argument '--version' which wasn't expected, or isn't valid in this context
    Did you mean --verbose?

USAGE:
    cargo run --example <NAME>... --verbose

For more information try --help
jlpoole@taurus /usr/local/src/retina $ 
scottlamb commented 2 years ago

I believe it already does, but when you run it in that way cargo thinks the --version is meant for it rather than for the command to be run.

Try cargo run --example client -- --version instead, or cargo build --example client && target/debug/client --version.

jlpoolen commented 2 years ago

Works. Thank you.

jlpoole@taurus /usr/local/src/retina $ cargo run --example client -- --version
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/examples/client --version`
retina 0.2.0
jlpoole@taurus /usr/local/src/retina $