Skip to content

Add --free alias#4

Open
bnap00 wants to merge 1 commit intomainfrom
codex/create-alias-for-free-port-as-free
Open

Add --free alias#4
bnap00 wants to merge 1 commit intomainfrom
codex/create-alias-for-free-port-as-free

Conversation

@bnap00
Copy link
Owner

@bnap00 bnap00 commented Jul 27, 2025

Summary

  • add --free alias for port freeing
  • show new alias in help output
  • mention alias in README examples and requirements

Testing

  • bash -n portscope.sh
  • bash portscope.sh --help | head -n 20
  • bash portscope.sh --free 1 | head -n 5

https://chatgpt.com/codex/tasks/task_e_6885f1b56eac8323b261b9ff399d2e25

Summary by CodeRabbit

  • New Features

    • Added a new command-line alias --free as an alternative to --free-port for freeing a specified port.
  • Documentation

    • Updated the README to document the new --free alias and clarified Docker CLI requirements for both options.
    • Improved help message to include the --free option.

@coderabbitai
Copy link

coderabbitai bot commented Jul 27, 2025

Walkthrough

The updates introduce a new alias command, --free, as an alternative to --free-port for freeing a port in the portscope.sh script. Corresponding changes were made to the help message, command-line parsing logic, and README documentation to reflect this addition and clarify Docker CLI requirements.

Changes

File(s) Change Summary
README.md Updated documentation to mention --free as an alias for --free-port and clarified requirements.
portscope.sh Modified help message and argument parsing to support --free as an alias for --free-port.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant portscope.sh

    User->>portscope.sh: Run with --free N or --free-port N
    portscope.sh->>portscope.sh: Parse arguments
    alt --free or --free-port detected
        portscope.sh->>portscope.sh: Check required commands
        portscope.sh->>portscope.sh: Call free_port(N)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Possibly related PRs

  • Add port freeing option #1: Adds and updates the port freeing functionality, directly related to the new alias and documentation changes in this PR.

Poem

A bunny hops with nimble glee,
"Now --free or --free-port, both work for me!"
The docs are crisp, the help is clear,
Freeing ports brings cheer near here.
With every flag, a rabbit’s delight—
Ports unbound, all through the night! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/create-alias-for-free-port-as-free

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
portscope.sh (1)

33-37: Help text: missing description for --free-port

Splitting the two flags onto separate lines dropped the explanatory text for --free-port, so the help now reads:

--free-port N
--free N      Attempt to free port N if it is in use

A quick tweak restores clarity:

-  --free-port N
-  --free N      Attempt to free port N if it is in use
+  --free-port N Attempt to free port N if it is in use
+  --free N      Alias for --free-port
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eceefb3 and 1f8833b.

📒 Files selected for processing (2)
  • README.md (2 hunks)
  • portscope.sh (2 hunks)
🔇 Additional comments (3)
README.md (2)

61-65: 👍 Alias example looks good

The extra example demonstrates the new --free alias clearly and keeps the section consistent with the existing --free-port example. No issues spotted.


95-100: Clarified requirement statement – approved

Updating the Docker-CLI remark to cover both --free-port and --free keeps the doc accurate.
No further action required.

portscope.sh (1)

236-240: Argument parsing covers both flags correctly

The case pattern --free-port|--free plus the single shift cleanly hands the port number to free_port, and free_port already validates the argument. Good change.

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.

1 participant