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

Enhanced CLI Plugins #1064

Merged
merged 20 commits into from
Jan 4, 2024
Merged

Enhanced CLI Plugins #1064

merged 20 commits into from
Jan 4, 2024

Conversation

attiasas
Copy link
Contributor

@attiasas attiasas commented Dec 7, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

  • Adding README.md to help using and implementing plugins.
  • Adding Namespace to App allowing to create sub commands at the plugin.
  • Adding PrintCommandHelp method to Context to allow for a dynamic way to print the command usage help for the plugins if an error occur while parsing the context for the command.

Enhancements have been made in generating automatic usage for help regarding CLI Plugins to encompass broader scenarios:

  • Arguments can be specified as optional (for help usage in commands such as download).
  • String flags can be designated as mandatory (for help usage in commands like offlineupdate).
  • Arguments can now be substituted with flags based on their names, generating usages for both scenarios (for help usage in most commands using the specFile flag instead of arguments, such as scan, download, move, etc.).
  • Commands can be concealed (Hidden) from printing in usage help (for deprecated commands like audit-go, xr scan, etc.).
  • In cases not adhering to the specially generated usage, you can specify UsageOptions to manually add to or replace the generated usages (for help usage in commands such as ocstartbuild).
  • Adding Category to commands.

@attiasas attiasas changed the title Move logic from CLI Enhanced Automatic Usage Generation for CLI Plugins Help Dec 7, 2023
@attiasas attiasas marked this pull request as ready for review December 7, 2023 15:09
@attiasas attiasas added the improvement Automatically generated release notes label Dec 7, 2023
Copy link
Contributor

github-actions bot commented Dec 7, 2023

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


@attiasas attiasas changed the title Enhanced Automatic Usage Generation for CLI Plugins Help Enhanced Automatic Usage Help Generation for CLI Plugins Dec 7, 2023
Copy link
Member

@yahavi yahavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good!

  • Please consider my inline comments.
  • Let's also talk about the design tomorrow
  • I think it is important to document in this or future PR instructions in the CONTRIBUTING.md how to contribute a command.

plugins/components/commandcomp.go Show resolved Hide resolved
plugins/components/commandcomp.go Outdated Show resolved Hide resolved
plugins/components/commandcomp.go Outdated Show resolved Hide resolved
plugins/components/commandcomp.go Show resolved Hide resolved
plugins/components/commandcomp.go Outdated Show resolved Hide resolved
plugins/components/conversionlayer.go Outdated Show resolved Hide resolved
plugins/components/conversionlayer.go Outdated Show resolved Hide resolved
plugins/components/conversionlayer.go Outdated Show resolved Hide resolved
plugins/components/conversionlayer.go Outdated Show resolved Hide resolved
plugins/README.md Outdated Show resolved Hide resolved
plugins/components/commandcomp.go Outdated Show resolved Hide resolved
plugins/components/commandcomp.go Show resolved Hide resolved
plugins/components/structure.go Show resolved Hide resolved
@attiasas attiasas changed the title Enhanced Automatic Usage Help Generation for CLI Plugins Enhanced CLI Plugins Jan 4, 2024
@attiasas attiasas merged commit acbd551 into jfrog:dev Jan 4, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants