rclone/lib
Carl Edquist 7130a6d2e4 terminal: use stderr for terminal progress output, etc
Avoid mixing rclone command output with progress output by sending
terminal output to stderr.

Discussion:

The --progress option produces output designed for the terminal, and the
terminal library sent all its output to stdout.

This is a problem for any command that produces output for further
processing, when combined with --progress, because the main command
output and the progress output are then sent together to stdout.

This is most obviously a problem for the rclone 'cat' command.  Say you
want to retrieve a large file but output to a pipe for further
processing, rather than write it to a file.  But you also want rclone to
display its progress output as you wait for the transfer.  Because both
the 'cat' output and the progress output go to stdout, this leaves the
progress output as garbage data within the streamed cat output, and also
prevents the progress output from being displayed.

Notably, other rclone commands like 'ls', 'lsjson', and even 'm5dsum',
produce meaningful progress output with the --progress option, but when
mixed with the regular command output, it makes both the progress output
and the command output unusable.

The simple solution here is to send output intended for the terminal
(including progress output) to stderr instead of stdout.  This way the
rclone command output can be redirected as desired from stdout, and the
progress output will still go to the terminal attached to stderr.

If for some reason the user wants to capture/redirect the
terminal/progress output for some other purpose, stderr can be
redirected instead.
2022-09-30 15:13:36 -05:00
..
atexit build: reformat comments to pass go1.19 vet 2022-08-05 16:35:41 +01:00
bucket build: reformat comments to pass go1.19 vet 2022-08-05 16:35:41 +01:00
buildinfo build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
cache all: fix spelling across the project 2022-08-30 11:16:26 +02:00
daemonize build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
dircache all: fix spelling across the project 2022-08-30 11:16:26 +02:00
encoder build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
env docs: punctuation cleanup 2021-10-20 22:56:19 +02:00
errors build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
exitcode cmd: Move exit status codes to separate package 2021-07-07 17:59:26 +01:00
file build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
http build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
israce build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
jwtutil all: fix spelling across the project 2022-08-30 11:16:26 +02:00
kv build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
mmap build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
oauthutil build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
pacer build: reformat comments to pass go1.19 vet 2022-08-05 16:35:41 +01:00
plugin build: reformat comments to pass go1.19 vet 2022-08-05 16:35:41 +01:00
pool test: Don't run unreliable tests on CI #4171 2020-06-15 21:34:37 +01:00
random Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
ranges Spelling fixes 2020-10-14 15:21:31 +01:00
readers build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
rest all: fix spelling across the project 2022-08-30 11:16:26 +02:00
structs staticcheck: ignore deprecations that are not relevant 2022-07-04 11:24:59 +02:00
terminal terminal: use stderr for terminal progress output, etc 2022-09-30 15:13:36 -05:00
version Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00