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

feat: add hideAliases help option #819

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Oct 11, 2023

  • Adds hideAliasesFromRoot to HelpOptions. When true, it filters command aliases from the COMMANDS section of the root help
  • Adds hiddenAliases property to Command allowing you to create command aliases that won't be visible in the help output

Fixes oclif/oclif#888

@mdonnalley mdonnalley added the enhancement New feature or request label Oct 11, 2023
@git2gus
Copy link

git2gus bot commented Oct 11, 2023

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

@mdonnalley mdonnalley force-pushed the mdonnalley/hide-aliases-option branch from d756ae9 to 1ac65fe Compare October 12, 2023 15:03
Copy link

@ryandagg ryandagg left a comment

Choose a reason for hiding this comment

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

Thank you!

@WillieRuemmele
Copy link
Contributor

QA Notes


setup:

build and link this PR into an OCLIF plugin


hidden aliases

add public static readonly hiddenAliases=['hidden']; to a command

✅ : ./bin/dev hidden runs the command
✅ : not present in ./bin/dev output
✅ : not present in --help alias section

help options

add

    "helpOptions": {
      "hideAliasesFromRoot": true
    },

to pjson.oclif

✅ : when true, hides aliases from bin output

 ➜  ./bin/dev 
demo plugin for testing
...

COMMANDS
  demo  Summary of a command.
  help  Display help for sf.

✅ : when omitted, or set to false

 ➜  ./bin/dev 
demo plugin for testing

...

COMMANDS
  demo     Summary of a command.
  help     Display help for sf.
  myalias  Summary of a command.

@WillieRuemmele WillieRuemmele merged commit e5f9d6e into main Oct 13, 2023
35 checks passed
@WillieRuemmele WillieRuemmele deleted the mdonnalley/hide-aliases-option branch October 13, 2023 15:43
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 this pull request may close these issues.

Option to hide aliases from root help commands list
3 participants