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

Revert "refactor(cli): cleanup parse_args.ts (#4189)" #4485

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Mar 14, 2024

This reverts commit 8c022c4.

fixes #4481

@github-actions github-actions bot added the cli label Mar 14, 2024
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

@timreichen, please feel free to reland your cleanup changes along with a passing test for the issue outlined in #4481.

@kt3k kt3k merged commit 469c3c6 into denoland:main Mar 14, 2024
12 checks passed
@kt3k kt3k deleted the revert-4189 branch March 14, 2024 06:35
@timreichen
Copy link
Contributor

timreichen commented Mar 14, 2024

I think I found the bug. The aliasMap Set for key contains key itself. On that example header contains header as an alias.

Map(2) {
  "H" => Set(1) { "header" },
  "header" => Set(2) { "H", "header" }
}

This is fixed by filtering out the key.

before:

const set = new Set([key, ...aliases]);
aliases.forEach((alias) => aliasMap.set(alias, set));

after:

aliases.forEach((alias) => aliasMap.set(alias, new Set([key, ...aliases.filter((it) => it !== alias)])));

@timreichen
Copy link
Contributor

PR #4487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parseArgs duplicates collected + aliased arguments
3 participants