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

cmd: migrate from cobra to jpillora/opts #27

Closed
cueckoo opened this issue Jul 3, 2021 · 3 comments
Closed

cmd: migrate from cobra to jpillora/opts #27

cueckoo opened this issue Jul 3, 2021 · 3 comments
Labels
NotNow May be considered later, but is too disruptive at this point.

Comments

@cueckoo
Copy link
Collaborator

cueckoo commented Jul 3, 2021

Originally opened by @wxio in cuelang/cue#27

Please take a look at https://github.com/jpillora/opts/tree/subcommands (work in progress). I think cue is a fascinating project and happy to contribute (I have started a similar project using protobufs as starting point).

Thought helping move from Cobra to Opts might be a good first start.

Related to #25, #9

One of this nice things about the work in progress on Opts is basic bash, zsh and fish command completion is free and highly customisable for more complex requirements.

@cueckoo cueckoo added the NotNow May be considered later, but is too disruptive at this point. label Jul 3, 2021
@cueckoo cueckoo closed this as completed Jul 3, 2021
@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#27 (comment)

What would be the benefit from moving to jpillora's package?

One reason to use Cobra is that Cobra is used by many of the tools that CUE is likely to be used in concert with (like Kubernetes). For instance, does it use POSIX flag semantics, or Go, or something else?

Also, I prefer to use more stable packages, even if they are less desirable. This package is too young.
But it is worth considering once it stabilises. I expect the command lines options and so on to require an overhaul once they are all defined (make flags consistent). That may be a good point to consider this.

Protobuf support is on the TODO list for CUE. That may be a better focus. :)

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#27 (comment)

Closing this for now. Cobra is awkward in a lot of ways, but it is familiar and under control.

The code is slowly abstracting away from it, but using something else does not make sense until there is a rewrite later.

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @marco-m in cuelang/cue#27 (comment)

For what is worth, for the future reconsideration, I used both https://github.com/jpillora/opts and https://github.com/alexflint/go-arg. I selected go-arg as my library of choice. It supports subcommands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NotNow May be considered later, but is too disruptive at this point.
Projects
None yet
Development

No branches or pull requests

1 participant