Skip to content

fix: tetherd silently ignored unknown flags and arguments - #13

Merged
praneethravuri merged 1 commit into
mainfrom
fix/tetherd-reject-unknown-flags
Jul 29, 2026
Merged

praneethravuri merged 1 commit into
mainfrom
fix/tetherd-reject-unknown-flags

Conversation

@praneethravuri

Copy link
Copy Markdown
Owner

Summary

  • tetherd never inspected os.Args, so any flag or positional argument was silently dropped and the daemon started normally regardless. Found while testing v0.1.0's install: tetherd -h bound the default socket and hung instead of printing usage or erroring.
  • parseArgs (stdlib flag package, no new dependency) now rejects anything on the command line: -h/--help print usage and exit 0, any unrecognized flag or stray positional argument prints an error and exits 2.

Test plan

  • New TestParseArgs covers: no args, -h, --help, unknown flag, stray positional arg
  • Manually verified the built binary: -h/--help exit 0 with usage, -x and foo exit 2 with a clear error, no more hang
  • go test -race -count=1 ./..., gofmt -s -l ., go vet ./..., golangci-lint run all clean
  • CI green on this PR

🤖 Generated with Claude Code

tetherd never inspected os.Args, so any flag or positional argument
-- typo, --help, a stray word -- was dropped and the daemon started
normally anyway. Found while testing v0.1.0: `tetherd -h` bound the
default socket and hung instead of printing usage.

parseArgs rejects anything on the command line via the stdlib flag
package: -h/--help now print usage and exit 0, anything else exits 2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@praneethravuri
praneethravuri merged commit 2343277 into main Jul 29, 2026
30 checks passed
@praneethravuri
praneethravuri deleted the fix/tetherd-reject-unknown-flags branch July 29, 2026 21:52
praneethravuri added a commit that referenced this pull request Aug 1, 2026
tetherd never inspected os.Args, so any flag or positional argument
-- typo, --help, a stray word -- was dropped and the daemon started
normally anyway. Found while testing v0.1.0: `tetherd -h` bound the
default socket and hung instead of printing usage.

parseArgs rejects anything on the command line via the stdlib flag
package: -h/--help now print usage and exit 0, anything else exits 2.
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.

1 participant