go-tuf icon indicating copy to clipboard operation
go-tuf copied to clipboard

Migrate command parsing library

Open asraa opened this issue 3 years ago • 1 comments
trafficstars

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.

asraa avatar Sep 27 '22 16:09 asraa

Specifically, flynn/go-docopt is archived and its upstream docopt/docopt.go has not been active for ~5 years.

joshuagl avatar Sep 28 '22 15:09 joshuagl

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.

joshuagl avatar Nov 15 '22 11:11 joshuagl

@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!

asraa avatar Nov 15 '22 14:11 asraa

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 👍

rdimitrov avatar Jan 31 '24 21:01 rdimitrov