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

improve topic help resolution if @oclif/plugin-help isn't available as a plugin #848

Closed
cristiand391 opened this issue Nov 3, 2023 · 1 comment · Fixed by #975
Closed
Labels
enhancement New feature or request

Comments

@cristiand391
Copy link
Member

Is your feature request related to a problem? Please describe.
when running typing <cli> <topic> without having @oclif/plugin-help as a plugin/devPlugin oclif fails to get topic help text and renders and instead throws Error: command help not found:

➜  sf-plugin-api git:(main) ./bin/dev org
Error: command help not found
    at Config.runCommand (/Users/cdominguez/code/gh/sf-plugin-api/node_modules/@oclif/core/lib/config/config.js:284:19)
➜  sf-plugin-api git:(main) ./bin/run org
 ›   Error: command help not found

Examples using this plugin: https://github.com/cristiand391/sf-plugin-api/

this is caused by core trying to run help <topic> when id is a valid topic:

if (topic) return config.runCommand('help', [id])

example:
./bin/dev org -> id = org
org is a valid topic in my plugin so it tries to run help org to render the help text.

Workaround

use --help so that core loads the helpclass without the help command:

if (helpAddition(argv, config)) {

Describe the solution you'd like
IMO, CLI plugins shouldn't be required to bring in @oclif/plugin-help as a devDependency. What if core just loads the helpclass instead of calling help.
If that's not possible, maybe the command help not found could be improved.

Describe alternatives you've considered
--help works.

Additional context
Found by Rupert Barrow 😉 , just wanted to file an issue with what I found while trying to get and answer for him:
https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007OYgsj

@mdonnalley mdonnalley added the enhancement New feature or request label Feb 22, 2024
Copy link

git2gus bot commented Feb 22, 2024

This issue has been linked to a new work item: W-15103728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants