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

Fix:(issue_1607) Allow exporting command and arguments/options to json #1855

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

dearchap
Copy link
Contributor

What type of PR is this?

(REQUIRED)

  • feature

What this PR does / why we need it:

(REQUIRED)

Allows us to have a starting point for a framework for exporting cli to JSON.

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #1607

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

Added a new test case TestJSONExportCommand which shows that the entire command graph can be exported to JSON.

Release Notes

(REQUIRED)

Once a root command is constructed. json.Marshal can be used to export the command graph to a string of bytes. This can be piped to a template rendering tool such as [tpl](https://github.com/bluebrown/go-template-cli)  along with a template file to render markdown/man pages. 

command.go Outdated Show resolved Hide resolved
Copy link

👍 Frogbot scanned this pull request and found that it did not add vulnerable dependencies.

Note:

Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.


Co-authored-by: Dan Buch <dan@meatballhat.com>
@dearchap dearchap merged commit 2b85f72 into urfave:main Dec 29, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToJSON or JSON format for import/export of CLI options
2 participants