Skip to content

fix: validate CLI port argument - #194

Open
WilliamK112 wants to merge 1 commit into
pavanvamsi3:mainfrom
WilliamK112:validate-cli-port
Open

fix: validate CLI port argument#194
WilliamK112 wants to merge 1 commit into
pavanvamsi3:mainfrom
WilliamK112:validate-cli-port

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Jun 17, 2026

Copy link
Copy Markdown

Summary

  • validate --port as an integer before starting the dashboard
  • reject non-numeric, zero/negative, fractional, and greater-than-65535 values with a clear CLI error
  • preserve the default port and valid boundary values

Closes #37.

Validation

  • npm run build
  • npm test — 8 test files, 120 tests passed
  • npx tsx src/cli.ts --port 0 exits 1 with the expected error
  • npx tsx src/cli.ts --port -1 exits 1 with the expected error
  • npx tsx src/cli.ts --port 99999 exits 1 with the expected error
  • npx tsx src/cli.ts --port abc exits 1 with the expected error
  • npx tsx src/cli.ts --port 3000.5 exits 1 with the expected error
  • npx tsx src/cli.ts --port 65535 starts successfully
  • git diff --check

Revalidated after refreshing the branch onto current main with Node.js 24.14.0.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

WilliamK112 commented Aug 9, 2026

Copy link
Copy Markdown
Author

Refreshed this onto current main (head d35506d) and revalidated it with Node.js 24.14.0. npm run build passes, all 120 existing tests pass, invalid/non-integral ports exit with the expected message, and port 65535 starts successfully. This PR remains limited to the assigned CLI port-validation issue #37.

@WilliamK112
WilliamK112 force-pushed the validate-cli-port branch 2 times, most recently from 50c51f3 to d35506d Compare August 9, 2026 13:34
@WilliamK112

Copy link
Copy Markdown
Author

Scope note: while checking the related issues, I found that #90 and #117 are already covered by the earlier contribution #144. I removed my overlapping test commit and the closing claims for those issues so that #144 retains its scope and attribution. This PR is back to the small, assigned #37 change only. Because #37 and #90 describe the same underlying validation, I will leave the preferred merge path to the maintainers and will not add further overlapping scope here.

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.

fix: validate port number CLI argument range

1 participant