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 example code in Readme_zh-CN.md #2313

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

fwgood
Copy link
Contributor

@fwgood fwgood commented Jan 17, 2025

Problem

There are differences between the Chinese and English readme, and the Chinese sample code cannot sit properly.

// En
const { program } = require('commander');

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

program.parse();

const options = program.opts();
const limit = options.first ? 1 : undefined;
console.log(program.args[0].split(options.separator, limit));
// Cn
const { program } = require('commander');

program
  .option('--first')
  .option('-s, --separator <char>');

program.parse();

const options = program.opts();
const limit = options.first ? 1 : undefined;
console.log(program.args[0].split(options.separator, limit));

Solution

Use English sample code in the Chinese version。

ChangeLog

Copy link
Collaborator

@shadowspawn shadowspawn left a comment

Choose a reason for hiding this comment

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

Thanks

@shadowspawn shadowspawn changed the base branch from master to develop January 17, 2025 07:20
@shadowspawn
Copy link
Collaborator

(I'll prepare a release with PR #2312 soon and this can get promoted to master branch with that.)

@abetomo abetomo merged commit 2619c99 into tj:develop Jan 17, 2025
11 checks passed
@shadowspawn shadowspawn added pending release Merged into a branch for a future release, but not released yet and removed pending release Merged into a branch for a future release, but not released yet labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants