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

fix(cli): Fix bad docusaurus CLI behavior on for --version, -V, --help, -h #10368

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

ashiq-firoz
Copy link
Contributor

@ashiq-firoz ashiq-firoz commented Aug 3, 2024

Motivation

Fix #10367

  • docusaurus -h/--help should exit with status code 0 instead of 1
  • docusaurus -V/--version should print the version and not the help, and should exit with status code 0 instead of 1

This lets Commander handle version/help properly, and remove useless workaround code

Test Plan

local test by @slorber

yarn workspace website docusaurus
yarn workspace website docusaurus --version
yarn workspace website docusaurus -V

yarn workspace website docusaurus -h
yarn workspace website docusaurus --help

yarn workspace website docusaurus start
yarn workspace website docusaurus build

yarn workspace website docusaurus docs:version myVersion

yarn workspace website docusaurus badCommand
yarn workspace website docusaurus --badOption

@facebook-github-bot
Copy link
Contributor

Hi @ashiq-firoz!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link

github-actions bot commented Aug 3, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🟠 73 🟢 98 🟢 96 🟢 100 Report
/docs/installation 🟠 54 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 74 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 60 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 54 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 69 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 75 🟢 100 🟢 100 🟠 86 Report

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 3, 2024
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Aug 8, 2024
@slorber slorber changed the title fixed : npx docusaurus --version incorrect program termination status #10367 fix(cli): Fix bad docusaurus CLI behavior on for --version, -V, --help, -h Aug 8, 2024
Copy link

netlify bot commented Aug 8, 2024

[V2]

Name Link
🔨 Latest commit 556df66
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/66b4c70d6dfedc00077e4425
😎 Deploy Preview https://deploy-preview-10368--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@slorber
Copy link
Collaborator

slorber commented Aug 8, 2024

Thanks for the initial PR but the code didn't rally work

I took the opportunity to fix this properly once for all

@slorber slorber merged commit 087a329 into facebook:main Aug 8, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npx docusaurus --version incorrect program termination status
3 participants