Closed chris-morgan closed 1 year ago
I agree that this is indeed an issue, and PRs are welcome here.
I haven't looked at #58 in detail, but I want to mention (to @LovecraftianHorror as well) that this is pretty common for cargo subcommands, because cargo provides no way to distinguish this scenario from running a nested cargo invocation.
; cargo flamegraph
Error: could not find 'Cargo.toml' in '/home/jnelson' or any parent directory
; cargo-flamegraph
flamegraph
USAGE:
cargo <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
SUBCOMMANDS:
flamegraph A cargo subcommand for generating flamegraphs, using inferno
help Print this message or the help of the given subcommand(s)
; cargo-flamegraph flamegraph
Error: could not find 'Cargo.toml' in '/home/jnelson' or any parent directory
I'm going to close this because cargo doesn't currently have a good way for subcommands to both accept a positional argument and support running without the first sweep
subcommand. cc https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/sender/232545-jyn/topic/Custom.20subcommand.20that.20can.20be.20used.20with.20or.20without.20cargo.3F
cargo-sweep …
andcargo sweep …
should be equivalent, with the possible (but not mandatory) exception of usage information differing by that one character.Instead,
cargo sweep …
is equivalent tocargo-sweep sweep …
. This leads to inconsistency with well-established conventions, and the help page being confusing, withcargo sweep --help
referring to cargo-sweep-sweep and talking about running the command ascargo-sweep sweep
.