Repository navigation
stop: one verb for a port or a name, with free and kill kept as they are - #27
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21. Phase 2's first piece.
Nobody should have to remember whether the verb takes a port (
free) or a name (kill).ports stop <port|name>decides by its argument:3000or:3000) stops whatever holds it, exactly asfreedoes.killdoes. Other users' rows it can't stop are skipped, as since kill: other users' pid-less rows are skipped, not failed #17.stoptakes the same flags:--force,--dry-run,--expectand--json.freeandkillkeep their v0.1.0 behaviour. They shipped, so scripts may call them. They're hidden from--helpbut otherwise untouched. All three commands are thin wrappers over the same two functions,freePortandkillName, so they can't drift apart. They are deliberately not aliases ofstop: aliasing would turnfree shopfrom an error (exit 2) into a stop.Everything points at
stopnow:--help, the README, the docs (oneports stopsection; the old#cmd-freeand#cmd-killanchors still land on it), the quickstart and the man page (ports-stop.1);sudohint on skipped rows, andwait's timeout hint;stpsuggestsstop, and a typo of a hidden-but-working command still suggests it (frees→free).One rule to know: anything all-digits is read as a port, as with
wait. Soports stop 2048stops port 2048. A project literally named2048stops by name withports kill 2048. Both the help text and the docs say this. The integration test hit it for real: the test fixture's temp folder is named003, andstop 003read it as port 3.How it was verified
npm run lint✓ andnpm run build✓.stopvsfree/killon real listeners, normalised for pid and start time. Every case gave the same output and the same exit code:stop 8795vsfree 8795stop :8795vsfree :8795stop shop --jsonvskill shop --json--dry-runstop 70000vsfree 70000New
TestStopCommand(integration) covers a bare port,:port, a name, and a miss exiting 1. The docs check (#20) now includesstopforms.Risk
Tier: risky (the kill path and exit codes).
stoponly dispatches to the existingfree/killbodies.fixtext onkill's skipped rows and doctor's suggested fixes now readports stop …instead ofports free …. The hiddenfreeandkillno longer have man pages; v0.1.0 had none.stopand leavesfreeandkillexactly as they are.A fresh-context review said ok to ship. It compared old and new binaries side by side: across 14 inputs,
free/killgave identical stderr and exit codes, and no input makesstopact more broadly thanfree/killwould. Its should-fixes are the second commit:hereandwait, which it can't answer;stopdidn't reject0,70000and:abcthe way the CLI does.The
fix-text change it flagged is named above.Notes for the release
New
ports stop <port|name>: one command for stopping by port or by name.ports freeandports killstill work as before.Generated by Claude Code