rust-secure-code / cargo-supply-chain

Gather author, contributor and publisher data on crates in your dependency graph.
Apache License 2.0
317 stars 19 forks source link

Use an argument parser #26

Closed Shnatsel closed 3 years ago

Shnatsel commented 3 years ago

Right now we have basic hand-rolled argument parsing. While it was sufficient for a prototype, its limitations are starting to show.

The sales pitch for https://github.com/rust-cli/climake looks nice - it's zero-dependency, 100% safe and generates the help text.

dutt commented 3 years ago

I'll take a look at this issue.

Owez commented 3 years ago

It may be best to use pico-args or continue with hand-rolled for now as the current iteration of the climake crate isn't of the best quality in hindsight.

I'll be rewriting it and hope to finish in ~1 month but for now it's probably best to go for pico-args or continue on with the current argparser. See https://github.com/rust-cli/climake/pull/9 for current status of the rewrite

Shnatsel commented 3 years ago

@Owez thanks for the heads-up!

To clarify, the help text will still be generated without the use of proc macros, right? Avoiding procedural macros is a requirement for me since they inflate the compilation time a great deal. However, the performance of formatting help text at runtime is not a concern, since it's an infrequent operation and is expected to take very little time anyway.

Owez commented 3 years ago

Yeah, no proc macros will be involved in the rewrite, just dumps to a passed io::Write buffer for simplicity when it comes to help generation. Some other changes such as more customization of args passed to the argument parser itself are also planned, along with sub-commands. For now, I'd recommend just using pico-args and writing up your own help messaging as it seems to be one of the only other off-the-self low dependency argparsers available.

Shnatsel commented 3 years ago

Done in #27 via pico-args