Closed jkellerer closed 3 months ago
@creativeprojects, let me know what you think about this and whether names need to be adjusted.
Yes, this is a very good idea.
I'm not too sure about the name of the flag either. We could also do:
log-output
(with something like dual
, log-only
) ?log-console
(boolean) ?🤔
name was also one thing were I wasn't sure yet. Had used log-commands
from default-command
.
Maybe add-output-to
(e.g. --add-output-to=log
, --add-output-to=console
, --add-output-to=all
)
Mostly the flag wont be needed as the auto
value should be fine. Also we have some commands where the output must not be sent to logs. It may be good to have a name that doesn't get in the way if output cannot be added.
Changed the name to "command-output", kind of a combination of yours and mine proposals :)
resticprofile --log=rp.log --command-output=log ...
resticprofile --log=rp.log --command-output=console ...
resticprofile --log=rp.log --command-output=all ...
resticprofile --log=rp.log --command-output=auto ...
# also valid
resticprofile --log=rp.log --command-output=log,console ...
Attention: Patch coverage is 92.85714%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 71.07%. Comparing base (
667180e
) to head (4061506
). Report is 1 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
commands.go | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR is a super-light version of outstanding PR #207 to control when command output is sent to logs, console or both, with a default of "
auto
" so that interactive usage isn't fully silent when log is specified (e.g. in global settings)... PR #207 is still required to have proper terminal output in this case but it is better than none.