Skip to content

feat: add shorthand flag for websocket option in command line#2287

Merged
Mzack9999 merged 1 commit intoprojectdiscovery:devfrom
ayanrajpoot10:dev
Oct 15, 2025
Merged

feat: add shorthand flag for websocket option in command line#2287
Mzack9999 merged 1 commit intoprojectdiscovery:devfrom
ayanrajpoot10:dev

Conversation

@ayanrajpoot10
Copy link
Contributor

@ayanrajpoot10 ayanrajpoot10 commented Oct 10, 2025

Adds a shorthand -ws flag for the existing -websocket probe in httpx, improving usability by providing a shorter, convenient alias for checking websocket support.

Summary by CodeRabbit

  • New Features

    • Added a short -ws alias for the --websocket command-line flag to streamline enabling websocket output. This is fully backward-compatible; existing uses of --websocket continue to work.
  • Documentation

    • Updated command help and README to include the -ws alias and clarify usage. No functional or runtime behavior changes were introduced.

@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Adds a short alias (-ws) for the websocket flag alongside -websocket, updating flag registration and README usage text. No functional or control-flow changes.

Changes

Cohort / File(s) Summary
Docs
README.md
Updated PROBES help/usage text to document -ws as an alias for -websocket.
CLI options
runner/options.go
Switched to BoolVarP to register the websocket flag with a short alias -ws in addition to -websocket; no other logic changed.

Sequence Diagram(s)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I twitch my ears at flags anew,
A tiny hop from “websocket” to “ws” will do.
No burrow reroute, no maze to redraw—
Just shorter paths for paws and claw.
Thump-thump! I cheer this tidy finesse,
Fewer keystrokes, same success.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly states the addition of a shorthand flag for the websocket option in the command line, accurately summarizing the main change without unnecessary detail.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7dfd091 and 8f33284.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • runner/options.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test Builds (windows-latest)
  • GitHub Check: Test Builds (macOS-latest)
  • GitHub Check: Test Builds (ubuntu-latest)
  • GitHub Check: Analyze (go)
  • GitHub Check: Functional Test (windows-latest)
  • GitHub Check: Functional Test (macOS-latest)
  • GitHub Check: release-test
🔇 Additional comments (2)
README.md (1)

116-116: LGTM! Documentation correctly reflects the code change.

The documentation update properly shows the new -ws short flag alongside the existing -websocket long flag. The format is consistent with other flag entries in the help text.

runner/options.go (1)

389-389: LGTM – add -ws short flag for --websocket, no conflicts detected.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mzack9999
Copy link
Member

@coderabbitai create an issue for this PR and link it to the PR

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Linked to issue #2292

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@Mzack9999, I'll create an issue for this PR and link them together.


🏁 Script executed:

#!/bin/bash

# Create an issue for the PR
gh issue create \
  --repo projectdiscovery/httpx \
  --title "Add shorthand flag for websocket option" \
  --body "This issue tracks the feature addition of a shorthand \`-ws\` flag for the existing \`-websocket\` probe option in httpx.

**Related PR:** #2287
**Requested by:** @Mzack9999

The PR adds a shorter alias to check websocket support from the command line, making it more convenient for users." \
  --assignee Mzack9999

# Get the issue number that was just created
ISSUE_NUMBER=$(gh issue list --repo projectdiscovery/httpx --author @me --limit 1 --json number --jq '.[0].number')

# Link the PR to the issue by adding a comment
gh pr comment 2287 \
  --repo projectdiscovery/httpx \
  --body "Linked to issue #${ISSUE_NUMBER}"

Length of output: 129


@Mzack9999, I've successfully created issue #2292 for this PR and linked them together.

The issue has been assigned to you and includes a reference to this PR.

@Mzack9999 Mzack9999 linked an issue Oct 15, 2025 that may be closed by this pull request
@Mzack9999 Mzack9999 merged commit f94f72d into projectdiscovery:dev Oct 15, 2025
14 checks passed
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.

Add shorthand flag for websocket option

2 participants