Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create cargo template as used in the book #53

Open
killercup opened this issue Jul 30, 2018 · 3 comments
Open

Create cargo template as used in the book #53

killercup opened this issue Jul 30, 2018 · 3 comments
Assignees
Labels
A-book Area: Documenting how to create CLIs E-help-wanted Call for participation: Help is requested to fix this issue.
Milestone

Comments

@killercup
Copy link
Collaborator

killercup commented Jul 30, 2018

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.

@killercup killercup added this to the RC milestone Jul 31, 2018
@killercup
Copy link
Collaborator Author

@Keats has a pretty neat template (for kickstart) here: https://github.com/Keats/rust-cli-template

@Dylan-DPC-zz
Copy link

Created an initial template here

We need to discuss which features should go into the template.

@yoshuawuyts
Copy link
Collaborator

yoshuawuyts commented Aug 17, 2018

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-panic integration
  • 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)
  • exitfailure doesn't use the log crate, which means logs can be inconsistent.
  • human-panic does 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.

@Dylan-DPC-zz Dylan-DPC-zz self-assigned this Aug 17, 2018
@epage epage added E-help-wanted Call for participation: Help is requested to fix this issue. A-book Area: Documenting how to create CLIs C-enhancement labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-book Area: Documenting how to create CLIs E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

4 participants