-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add JSON Export for App #918
Comments
Great suggestion, I'd love this. I have it on the back burner to add |
I was toying around with making a soft version of this that just spits out some json but it's not clear on what basis this could be implemented. I was taking the completion code as a reference (the zsh one spits out most of the info I need) but it uses lots of internal APIs. I wonder if it would make sense to base the completion code on an abstraction that could become public and then also be used for other exporting. |
I bet providing |
Also I should also add, providing |
So actually providing a JSON/YAML serialization doesn't seem to be that hard, and is pretty straight forward. Maybe I can knock it out this week. I will want the |
You could keep serde internal for now and just provide an export to JSON / YAML function that directly writes to a writer. |
Blocked by dtolnay/serde-yaml#94 |
AFAIU, serde-yaml lifetime limitations are not really blockers: one can serialize to JSON at first, and then serialize Also, JSON seems to be subset of YAML, so json-serialized string can be interpreted as yaml. |
Forgot which issue I was on, in general, exporting isn't blocked on the lifetime issue, only importing and only for yaml. I'm assuming we'd want to solve these several issues (#853, #1630, this one) together, providing a single serialization/deserialization experience and not have serde for most types and then a special case for deserializing from yaml, which would make the lifetime issue a blocker. |
How much would #2914 help in this case? The idea would be that help generation is split into the generator and formatter. This would allow user-defined formatters, like man pages. Would that work for this case? |
It would be great to be able to export the app with all subcommands, options and args to JSON (or something similar) so documentation tools can then pick up on it and make documentation pages.
The text was updated successfully, but these errors were encountered: