team
team copied to clipboard
Create cargo template as used in the book
The book currently refers to a template you can get with cargo-generate to start writing your CLI crate.
This template repo doesn't exist! We should crate one.
Feel free to be inspired by quicli.
@Keats has a pretty neat template (for kickstart) here: https://github.com/Keats/rust-cli-template
Here's example output generated by my own CLI generator (example, template, generator). Some notable features include:
- exitfailure integration for a series of error causes to be shown.
-
human-panicintegration - colored CLI output through
structopt - logger + log levels enabled by default
- autocompletion
- structured error definitions for the lib portion of the app
Some things I wish were better:
- man page generation (hopefully soon)
-
exitfailuredoesn't use thelogcrate, which means logs can be inconsistent. -
human-panicdoes not show the error that caused the crash, which is not ideal during development. - all dependencies for the lib portion of the crate must also be build dependencies. This almost feels like a bug, but I haven't been able to figure out how to solve it.