Skip to content

fix(argv): -h/--help intercept on cmd_peers/disconnect/quit/invite/version/ping/tests (round 2) - #251

Merged
joelteply merged 1 commit into
canaryfrom
fix/help-intercept-sweep-round-2
Apr 28, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/help-intercept-sweep-round-2

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

continuum-b741 verb-fuzz round 2 found 6 verbs missed by #237's sweep — including 'airc disconnect/quit --help' which actually EXECUTED. Fixes both function-level intercepts AND the no-args dispatch branches in airc top-level.

…rsion/ping/tests

continuum-b741's verb-fuzz round 2 against canary HEAD found 4
regressions / wart that #237's sweep missed:

- airc peers --help: ignored (no intercept)
- airc disconnect / quit --help: EXECUTED the disconnect (their monitor died)
- airc invite (no-args dispatch): --help fell through to invite logic
- airc version (no-args dispatch): same
- airc ping --help: exited 1 not 0
- airc tests --help: exited 2 inconsistently

## Fix

Added -h/--help intercepts to: cmd_peers, cmd_disconnect, cmd_invite,
cmd_version, cmd_ping, _doctor_run_tests.

Plus dispatch fixes in airc top-level: invite/version/disconnect/quit
case branches now `shift; cmd_X "$@"` so flags reach the function.
Previously they called cmd_X with no args, so --help on the cmdline
never reached the function-level intercept.

Verification: tabs 19/0; manual exercise of all 7 --help paths.
Copilot AI review requested due to automatic review settings April 28, 2026 23:00
@joelteply
joelteply merged commit 1944819 into canary Apr 28, 2026
1 check passed
@joelteply
joelteply deleted the fix/help-intercept-sweep-round-2 branch April 28, 2026 23:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes missed -h/--help interception paths for several airc verbs so --help doesn’t fall through into real execution (including destructive paths), and ensures top-level dispatch forwards args to the underlying command functions.

Changes:

  • Add -h/--help intercept blocks to cmd_version, cmd_disconnect, cmd_ping, cmd_invite, cmd_peers, and _doctor_run_tests.
  • Update airc top-level dispatch to shift and pass "$@" for invite/share/join-string, version/--version/-v, and disconnect/quit/leave/unbind.
  • Provide consistent Usage: output for these verbs when invoked with help flags.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/airc_bash/cmd_update.sh Adds -h/--help intercept to cmd_version.
lib/airc_bash/cmd_teardown.sh Adds -h/--help intercept to cmd_disconnect.
lib/airc_bash/cmd_send.sh Adds -h/--help intercept to cmd_ping.
lib/airc_bash/cmd_rooms.sh Adds -h/--help intercepts to cmd_invite and cmd_peers.
lib/airc_bash/cmd_doctor.sh Adds -h/--help intercept to _doctor_run_tests.
airc Fixes dispatch to forward args into cmd_invite, cmd_version, and cmd_disconnect.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +268 to +269
echo " airc disconnect / quit leave the mesh: kill processes + clear host pairing"
echo " (identity, peers, message history preserved)"

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

The help text only mentions disconnect / quit, but the top-level dispatch also routes leave and unbind to cmd_disconnect. Update the Usage line to include all supported aliases (or use a generic form like airc disconnect|quit|leave|unbind) so airc leave --help / airc unbind --help aren't misleading.

Suggested change
echo " airc disconnect / quit leave the mesh: kill processes + clear host pairing"
echo " (identity, peers, message history preserved)"
echo " airc disconnect|quit|leave|unbind leave the mesh: kill processes + clear host pairing"
echo " (identity, peers, message history preserved)"

Copilot uses AI. Check for mistakes.
Comment thread lib/airc_bash/cmd_send.sh
Comment on lines +360 to +362
echo " airc ping @peer liveness probe (default 10s timeout)"
echo " airc ping @peer <timeout> override timeout (positive integer seconds)"
return 0 ;;

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

The Usage text says the timeout is a “positive integer seconds”, but the current validation accepts 0 (it only rejects non-digits/empty). Either tighten the check to reject 0, or adjust the help wording/error message to match the actual accepted range.

Copilot uses AI. Check for mistakes.
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.

2 participants