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

Update README and quick-start for allowExcessArguments change #2266

Merged

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Oct 12, 2024

The README had not been updated to describe excess arguments as now an error by default. While doing so, I noticed some examples which need updating due to the stricter checks.

@@ -2,7 +2,7 @@ const { program } = require('commander');

// This is used as an example in the README for the Quick Start.

program.option('--first').option('-s, --separator <char>');
program.option('--first').option('-s, --separator <char>').argument('<string>');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
program.option('--first').option('-s, --separator <char>').argument('<string>');
program
.option('--first')
.option('-s, --separator <char>')
.argument('<string>');

How about a line break to match the README?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We run Prettier over the example files (but not over the source code in the README) and Prettier uses the compact layout for the short chaining calls in the simple example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have wondered about whether should use the Prettier layout in the README, but I prefer being able to manually layout code and take extra space where I think it helps. Might just be habit though!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I got it.

@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Oct 13, 2024
@shadowspawn shadowspawn merged commit 2c9051a into tj:release/13.x Oct 13, 2024
9 checks passed
@shadowspawn shadowspawn deleted the feature/update-excess-args-docs branch October 13, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending release Merged into a branch for a future release, but not released yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants