Skip to content

feat(receive): support custom filename and stdout destination with stderr piping - #388

Open
AdamMagued wants to merge 1 commit into
claudiodangelis:mainfrom
AdamMagued:fix-issue-387
Open

AdamMagued wants to merge 1 commit into
claudiodangelis:mainfrom
AdamMagued:fix-issue-387

Conversation

@AdamMagued

Copy link
Copy Markdown

Fixes #387

Summary of Changes

  1. Added --file / -f flag to receive command to specify a custom destination filename, or - to stream received payload directly to stdout.
  2. Added --output-dir flag while preserving --output / -o for directory configuration to maintain backward compatibility.
  3. Added terminal output pipe detection in util.OutputIsPipe().
  4. Redirected QR code rendering, server status output, transfer progress bar, and logger messages to stderr when standard output is piped or when outputting received content to stdout (--file -).
  5. Added automated unit tests covering flag parsing, pipe detection, server receive targets (custom filename, collision disambiguation, and stdout streaming), and piped logger/QR rendering.

…derr piping

Add --file / -f flag to specify destination filename or - for stdout.

Add --output-dir flag while preserving --output for backward compatibility.

Redirect QR code, transfer progress, and informational messages to stderr when stdout is piped or writing to stdout.

Add unit tests covering flag parsing, piped logging, stdout output, and custom destination paths.
@AdamMagued

Copy link
Copy Markdown
Author

Rebased onto upstream main and resolved merge conflicts:

  • config/config.go: Integrated --output-dir flag fallback with upstream's applyFlags helper
  • server/server.go: Aligned upload receiver and destination routing with upstream's app.Shutdown() lifecycle and error-handled util.ReadFilenames
  • server/server_test.go: Merged upstream's test suite with custom destination, collision deduplication, and stdout streaming test cases
  • Passed sandbox verification across go test -v ./..., go test -race ./..., go vet ./..., and golangci-lint

lmk if you need any adjustments

This branch has not been deployed

No deployments
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.

Receive to a custom file name or stdout, and print messages to stderr when piped

1 participant