argh
argh copied to clipboard
Only display name of binary
I'm having a weird issue with the generated help message: the command is with it's absolute path when I run ./target/debug/mycmd --help
What am I doing wrong?
./target/debug/mycmd --help
Usage: ./target/debug/mycmd [<test_file...>] -a <address> [-p <port>]
MyCMD
Options:
-a, --address address
-p, --port port
--help display usage information
#[derive(FromArgs)]
/// MyCMD
struct Opt {
#[argh(option, short = 'a')]
/// address
address: String,
#[argh(option, short = 'p')]
/// port
port: Option<u32>,
#[argh(positional)]
/// script files to run
test_file: Vec<PathBuf>,
}
You aren't doing anything wrong, that's currently how it currently works!
If you cd into that directory and run it as /mycmd --help
it should display Usage: ./mycmd ...
It's not baked into the binary at compile time, it's the first argument grabbed from the environment.
Thank you for your answer!
I see!
I think there's an issue on Windows because even in the folder, I get the absolute path :-/
It works on Linux though!
Yeah, on Windows I also get an absolute path :/
I believe this was closed by #44 , at least i can't reproduce this anymore.
We still need a release to be able to use it through crates.io :)