Skip to content

Print usage on -h/--help in omarchy-tailscale-send - #18806

Merged
dhh merged 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/7adbb06f-5fe5-4de2-8eec-3f5c2f82ea9e
Nov 15, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/7adbb06f-5fe5-4de2-8eec-3f5c2f82ea9e

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Running omarchy-tailscale-send --help in bin/omarchy-tailscale-send opens a file picker titled "Send to --help" instead of printing usage.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Return to open a terminal.
  2. Type omarchy-tailscale-send --help and press Enter.
  3. A file picker opens titled "Send to --help" instead of printing Usage: omarchy-tailscale-send <machine> [file...].

More cases

Direct -h treated as machine name

Before After
before after

Direct invocation as `omarchy-tailscale-send --help` or `-h` treated the flag as the machine name and opened the file picker titled "Send to --help"/"Send to -h". Add a check matching other bin/ scripts that prints `Usage: omarchy-tailscale-send <machine> [file...]` and exits 0 before the machine assignment, so no picker opens.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] No new issue blocks merging.

Summary

omarchy-tailscale-send now prints usage and exits successfully when its first argument is -h or --help.

  • Help flags print usage and exit before file sharing starts.

Reviews (3) · Last reviewed commit: "Drop the standalone tailscale-send help ..." · Reviewed by Greptile

Comment thread bin/omarchy-tailscale-send Resolved
ThePrimeagen and others added 2 commits November 13, 2026 15:30
Run the command directly with each flag and check it succeeds, prints its usage line and never opens the file picker. Before the fix the flag was taken as the machine name and the picker opened.

Co-authored-by: Cursor <cursoragent@cursor.com>
A five-line usage guard copied from omarchy-plugin-enable does not warrant a new test file with a stubbed picker; AGENTS.md asks for no new test file for a small change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed d280bb8, which removes test/shell.d/tailscale-send-test.sh and leaves the -h/--help guard exactly as written.

The bug is real when omarchy-tailscale-send --help is called directly: it treated --help as the machine and opened a picker titled "Send to --help". omarchy tailscale send --help was already handled by the router. The test did catch that bug, but it added a new 24-line file with a stubbed picker to cover a five-line usage guard copied from omarchy-plugin-enable. Omarchy's AGENTS.md asks for tests sized to the change and against new test files for small changes, so no test was kept. The PR had no other tests.

Checked on an Omarchy ISO worker. With the guard, -h and --help print usage to stdout and exit 0, and the file picker never opens. Without the guard, --help opens the picker with "--help" as the machine. With no arguments, the command still prints usage to stderr and exits 1. ./test/cli passes.

Codex Medium reviewed the commit and found nothing wrong. It confirmed nothing else refers to the deleted file, since test/shell finds *-test.sh files by globbing, and it agreed no replacement test is needed. Its independence is not guaranteed. This is ready for the maintainer.

@dhh
dhh merged commit 3b717fa into omacom:quattro Nov 15, 2026
3 of 4 checks passed
ButtercupRobrts pushed a commit to ButtercupRobrts/omarchy that referenced this pull request Nov 28, 2026
* Handle -h/--help in omarchy-tailscale-send before using $1 as machine

Direct invocation as `omarchy-tailscale-send --help` or `-h` treated the flag as the machine name and opened the file picker titled "Send to --help"/"Send to -h". Add a check matching other bin/ scripts that prints `Usage: omarchy-tailscale-send <machine> [file...]` and exits 0 before the machine assignment, so no picker opens.

* Test that omarchy-tailscale-send -h and --help print usage

Run the command directly with each flag and check it succeeds, prints its usage line and never opens the file picker. Before the fix the flag was taken as the machine name and the picker opened.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop the standalone tailscale-send help test

A five-line usage guard copied from omarchy-plugin-enable does not warrant a new test file with a stubbed picker; AGENTS.md asks for no new test file for a small change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3b717fa)
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.

3 participants