From 35d6bc19aa3d3cb7c9191c89aeccd01a42787e11 Mon Sep 17 00:00:00 2001 From: Pol Alzina Date: Thu, 25 Jun 2026 12:53:31 +0200 Subject: [PATCH] feat: regroup --help flags by role and show -h/-v shorthands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the COMMON/ADVANCED split — which mixed send- and receive-only flags in one long list — with SENDING / RECEIVING / GENERAL / ADVANCED, matching the tool's send-or-receive model and the usage docs. A user now jumps straight to their mode instead of scanning past the other half's flags, and the occasional ones (--dry-run, --checksum) sit with their mode rather than padding a "common" shortlist. Also list the -h / --help and -v / --version shorthands, which already work but weren't shown. Header bolding is generic (any ALL-CAPS line), so the new section names need no logic change. Co-Authored-By: Claude Opus 4.8 (1M context) --- cmd/fsend/root.go | 20 ++++++++++++-------- cmd/fsend/root_test.go | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cmd/fsend/root.go b/cmd/fsend/root.go index 930d102..9b5c142 100644 --- a/cmd/fsend/root.go +++ b/cmd/fsend/root.go @@ -247,7 +247,7 @@ EXAMPLES Use a different server: fsend --connect relay.mycompany.com:443 -COMMON FLAGS +SENDING --text "" Send a literal string instead of a file (the receiver prints it — nothing is saved; keep it with: fsend > note.txt) @@ -255,30 +255,34 @@ COMMON FLAGS Bare --pass prompts interactively — sender side suggests a fresh random default (press Enter to accept). Env: FSEND_PASS. + --exclude Skip entries matching these globs in a directory + --name Override the hostname shown to the peer + +RECEIVING + --yes Auto-accept incoming transfers (no prompt) --out Receive into this directory (default: current) --out - Receive to stdout (single file, text, or piped stream — pipe-friendly: fsend --out - | …) - --yes Auto-accept incoming transfers (no prompt) --overwrite Replace existing files that differ (identical files are always skipped) --dry-run Show what would transfer (new/identical/differs), write nothing --checksum Decide identical files by content hash, not size+mtime (like rsync -c) + +GENERAL --quiet Suppress all non-error output - --name Override the hostname shown to the peer - --exclude Skip entries matching these globs in a directory - --help Show this help - --version Show version + --debug Verbose logging to stderr (also: FSEND_DEBUG=1) + --help, -h Show this help + --version, -v Show version -ADVANCED FLAGS +ADVANCED --connect Show current server --connect Set the server (persisted) --connect , Set the server + shared password --connect default Revert to the compiled-in default server --send / --receive Force mode (skip code/path auto-detect) - --debug Verbose logging to stderr (also: FSEND_DEBUG=1) --update Update fsend to the latest release --uninstall Remove the fsend binary and its config dir diff --git a/cmd/fsend/root_test.go b/cmd/fsend/root_test.go index 9d58385..005e2d7 100644 --- a/cmd/fsend/root_test.go +++ b/cmd/fsend/root_test.go @@ -219,8 +219,8 @@ func TestBoldHelpHeaders(t *testing.T) { t.Setenv("NO_COLOR", "") t.Setenv("FORCE_COLOR", "1") got := boldHelpHeaders(helpTemplate) - for _, header := range []string{"USAGE", "EXAMPLES", "COMMON FLAGS", - "ADVANCED FLAGS", "LEARN MORE"} { + for _, header := range []string{"USAGE", "EXAMPLES", "SENDING", + "RECEIVING", "GENERAL", "ADVANCED", "LEARN MORE"} { if !strings.Contains(got, "\x1b[1m"+header+"\x1b[0m") { t.Errorf("header %q not bolded", header) }