cargo-sweep icon indicating copy to clipboard operation
cargo-sweep copied to clipboard

-t requires a <days> argument but the help says it has a default value

Open mattico opened this issue 3 years ago • 1 comments

$ cargo sweep --help
...
    -t, --time <days>                Number of days backwards to keep. If no value is set uses 30.
...
$ cargo sweep -t
error: The argument '--time <days>' requires a value but none was supplied

USAGE:
    cargo-sweep.exe sweep <--stamp|--file|--time <days>|--installed|--toolchains <toolchains>|--maxsize <maxsize>>

Also it appears that the --version flag doesn't work:

$ cargo sweep -V
cargo-sweep.exe-sweep
$ cargo sweep --version
cargo-sweep.exe-sweep
$ cargo sweep --version -v
cargo-sweep.exe-sweep

I installed with cargo install minutes ago so I have version 0.5.0.

mattico avatar Mar 25 '21 15:03 mattico

As for --time's help text I agree that it's strange since an argument is required and I didn't notice any logic regarding some fallback value either (the current approach .expect()s a time value along with .expect()ing it being a valid u64

As for the version flag being weird I have a tentative fix opened in #58 since cargo is currently invoking a subcommand that doesn't have a version (hinted by the extra -sweep)

CosmicHorrorDev avatar Jun 26 '21 07:06 CosmicHorrorDev

--version is working, and here's the --time wrong usage message:

$ cargo sweep -t
error: a value is required for '--time <TIME>' but none was supplied

And the help message.

$ cargo sweep --help
...
  -t, --time <TIME>
          Number of days backwards to keep

So this issue is solved (ping @jyn514).

marcospb19 avatar Feb 02 '23 01:02 marcospb19