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

Help strips strings from USAGE flags when they match command alias #1089

Closed
zmully opened this issue May 31, 2024 · 2 comments · Fixed by #1090
Closed

Help strips strings from USAGE flags when they match command alias #1089

zmully opened this issue May 31, 2024 · 2 comments · Fixed by #1090
Labels
bug Something isn't working

Comments

@zmully
Copy link

zmully commented May 31, 2024

Describe the bug

When generating the README for <!-- commands --> section for aliases, the generator strips any string matching the command alias from any flag values in the USAGE section.

We have a command with an alias a, and when the README is generated with npx oclif readme, the USAGE output for that alias command documentation is missing the character a from the USAGE string.

Expected output:

USAGE
  $ px a [--debug] [-r us-east-1|us-west-2] [-p <value>]

Actual output:

USAGE
  $ px a [--debug] [-r us-est-1|us-west-2] [-p <vlue>]

Note the strings us-est-1 and vlue in the output

To Reproduce
Steps to reproduce the behavior:

  1. for any flag value in a command, add an alias to the command matching either a character or string of characters in the flag. For example, if you have command with a flag value of us-east-1, set a command alias of any substring of that value, east, a, us-east-1, etc.
  2. Generate README including alias documentation (npx oclif readme --aliases)
  3. Review the generated README.md and note that the command USAGE output is missing the aliases substring from the flag output.

Your Environment (please complete the following information):

  • oclif Version [e.g. 4.5.0].
    • @oclif/core@3.26.6
    • oclif@4.11.3
  • OS & version: [e.g. MacOS Monterey, Ubuntu 20.04.4 LTS, Windows 10]
    • Ubuntu 22.04 ARM
    • MacOS 14.4.1 ARM
    • node 20.14.0
    • node 18.14.2
  • Shell/terminal & version [e.g. bash-3.2, bash-5.0, zsh 5.8, powershell 7.2.4, cmd.exe, Windows Terminal w/ powershell, etc... ]
    • zsh 5.6
    • bash 5.1.16

Additional context

This only occurs with the first matching command alias.

@mdonnalley
Copy link
Contributor

@zmully Thanks for the issue. It looks like it happens on --help too, which means this is an issue in oclif/core - not the readme command. I'll transfer the issue to that repo

Stay tuned for a fix

@mdonnalley mdonnalley transferred this issue from oclif/oclif May 31, 2024
@mdonnalley mdonnalley changed the title Readme generator > v4 strips strings from USAGE flags when they match command alias Help strips strings from USAGE flags when they match command alias May 31, 2024
@mdonnalley mdonnalley added the bug Something isn't working label May 31, 2024
Copy link

git2gus bot commented May 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants