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 --aliases flag for readme command #925

Merged
merged 3 commits into from Sep 6, 2022

Conversation

shazron
Copy link
Contributor

@shazron shazron commented Jul 27, 2022

This is to allow for --no-aliases so the README being generated for a plugin does not include aliases, which may clutter the documentation.

Example usage in package.json:

{
  "scripts": {
      "prepack": "oclif manifest && oclif readme --no-aliases"
  }
}

Copy link
Contributor

@mdonnalley mdonnalley left a comment

Choose a reason for hiding this comment

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

@shazron thanks for the contribution - this is a great idea!

}

static aliases = ['rdm']
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to not put an alias on this command unless there's overwhelming demand for it

Copy link
Contributor Author

@shazron shazron Jul 27, 2022

Choose a reason for hiding this comment

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

Me neither, but I will have to figure out another way to test this then...

Copy link
Contributor

Choose a reason for hiding this comment

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

@shazron You can emulate the tests that use the fixtures. For example,

describe('with custom help that does not implement formatCommand', () => {

Basically, you just need to add a CLI with an alias'd command to the fixtures directory and use that for your test case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gotcha, I'll amend the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mdonnalley I've resolved it to use a custom fixture. However the tests are failing due to AWS_ACCESS_KEY_ID not being set. I assumed the CI would set this in its environment, but it's failing there as well. Those tests are not relevant to this PR and I never touched them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #951

@mdonnalley mdonnalley changed the base branch from main to mdonnalley/925 September 6, 2022 15:26
@mdonnalley mdonnalley merged commit 1c08b83 into oclif:mdonnalley/925 Sep 6, 2022
mdonnalley added a commit that referenced this pull request Sep 6, 2022
* feat: add `--aliases` flag for readme command

* fix: create test fixture to test --no-aliases flag

* fix: eslint issues

Co-authored-by: Shazron Abdullah <36107+shazron@users.noreply.github.com>
gaelmotte pushed a commit to gaelmotte/oclif that referenced this pull request Oct 24, 2022
* feat: add `--aliases` flag for readme command

* fix: create test fixture to test --no-aliases flag

* fix: eslint issues

Co-authored-by: Shazron Abdullah <36107+shazron@users.noreply.github.com>
@shazron shazron deleted the flag-no-aliases branch January 5, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants