go-tuf
go-tuf copied to clipboard
Migrate command parsing library
https://github.com/theupdateframework/go-tuf/pull/395#pullrequestreview-1117228873
We should move to a more maintainer, but still lightweight CLI managing library. We want it to:
- Be able to configure logging help messages and usage
- Be actively maintained
In particular, we should fix bad args and bad commands so that usage is printed on Stderr rather than Stdout as it currently is.
Specifically, flynn/go-docopt is archived and its upstream docopt/docopt.go has not been active for ~5 years.
Cobra and mitchellh/cli seem like popular options.
@asraa when you say "lightweight" do you mean in terms of API and developer ergonomics or in terms of the dependency footprint?
On the latter, for each library I created an empty Go project and added the library (go get <cli-lib>), Cobra adds 3 entries to go.mod while mitchellh/cli adds 20.
@asraa when you say "lightweight" do you mean in terms of API and developer ergonomics or in terms of the dependency footprint?
still lightweight in terms of dependency foot print (which I think was the original motivation).
I'm more familiar with cobra, so +1 to that!
Closing since the code base changed and the goal of the project would be to focus on being a library first and not so much on providing a CLI client.
There might be a CLI based on this, but it will live in a separate repository.
Thanks for raising this 👍