Shnatsel / cargo-loc

Count lines of code across your entire dependency tree
13 stars 0 forks source link

--help panics app #2

Open qarmin opened 2 months ago

qarmin commented 2 months ago
cargo-loc --help

panics with this info

thread 'main' panicked at /home/rafal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-loc-0.1.2/src/main.rs:17:10:
called `Result::unwrap()` on an `Err` value: NoJson
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: cargo_loc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
TadoTheMiner commented 2 months ago

This could be resolved by using clap

TadoTheMiner commented 2 months ago

But wait, the programdoesn't have help

Shnatsel commented 2 months ago

I've used bpaf for it in the past, and I prefer it over clap for its lower LoC and binary size footprint. Here's an example of it being used in a similar Cargo subcommand: https://github.com/rust-secure-code/cargo-supply-chain/blob/master/src/cli.rs

But I won't turn down a PR adding clap either.

TadoTheMiner commented 2 months ago

In my opinion using the standards is more important than binary size especcialy in small projects, but your project your choice