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

ToJSON or JSON format for import/export of CLI options #1607

Closed
abitrolly opened this issue Nov 30, 2022 · 2 comments · Fixed by #1855
Closed

ToJSON or JSON format for import/export of CLI options #1607

abitrolly opened this issue Nov 30, 2022 · 2 comments · Fixed by #1855
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this
Milestone

Comments

@abitrolly
Copy link
Contributor

I wonder if it is possible to create a generic options definition serialization/exchange format in JSON?

Then the stuff like Markdown help, man pages and command line completion (https://github.com/urfave/cli/pull/1606/files) could be generated from that JSON format by external tools without bloating the size of urfave/cli binaries (#1594).

I already tried to play with that a bit with Python here - abitrolly/podman-compose@0cd4197 - so it is possible to extract that bit to see if urfave/cli export and Python argparse export can be compatible.

@abitrolly abitrolly added kind/question someone asking a question area/v2 relates to / is being considered for v2 status/triage maintainers still need to look into this labels Nov 30, 2022
@dearchap
Copy link
Contributor

dearchap commented Dec 1, 2022

@abitrolly yes I'm sure its possible. The completion here in cli is minimal except for the fish completion code. Do you have any serialization formats and tools in mind for this ?

@abitrolly
Copy link
Contributor Author

I have no particular format in mind. It should probably be designed from scratch. The use case is to generate everything that is currently possible (man, markdown, completions) given just the JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants