This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Description
I'm not sure whether this is expected behavior, but the following seems a bit strange to me:
static USAGE: &'static str = "
Description
Usage:
prog subcommand <arg>
";
fn main() {
let d = docopt::Docopt::new(USAGE).unwrap().help(true).parse().unwrap();
println!("{:?}", d);
}
The above program works fine (cargo run -- subcommand arg). However, if the subcommand is changed to start with the binary name (new usage string: prog progsubcommand <arg> ), running cargo run -- progsubcommand arg will fail with 'Invalid arguments...'. But running cargo run -- subcommand arg will again work. The problem does not occurr on http://try.docopt.org/.