Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ portscope custom.yml # Parse a specific file directly

```bash
portscope --free-port 8080 # Try to free port 8080
portscope --free 8080 # Same as above using alias
portscope --free-port 8080 --yes # Free port 8080 without prompts
portscope --help # Show help message
portscope --version # Show version number
Expand Down Expand Up @@ -95,7 +96,7 @@ Simple. Fast. No surprises.

- Bash
- `ss` (part of `iproute2` package)
- Docker CLI (optional for `--free-port`)
- Docker CLI (optional for `--free-port` or `--free`)

---

Expand Down
5 changes: 3 additions & 2 deletions portscope.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Check if ports defined in a docker-compose.yml file are already in use.
Options:
--help Show this help message
--version Show version information
--free-port N Attempt to free port N if it is in use
--free-port N
--free N Attempt to free port N if it is in use
--yes Assume "yes" for all prompts
EOF
}
Expand Down Expand Up @@ -232,7 +233,7 @@ case "$1" in
show_version
exit 0
;;
--free-port)
--free-port|--free)
shift
check_requirements ss awk grep ps kill
free_port "$1"
Expand Down