Problem
When running Kosli CLI as part of the CI pipeline sometimes stdErr and stdOut are multiplexed, e.g. Docker, GHA, etc. and writing to stdErr might pollute the output and break the workflow depending or parsing that output.
Proposed approach
Following the discussion in Slack the solution might be to detect when there is no TTY and ignore printing to stdErr. This approach would need to ensure all the output going for stdErr is silently dropped/ignored and only stdOut is printed out.
Context
We recently introduced checking ofr latest version which prints out a notice when not running the latest CLI. It outputs to stdErr only when not outputting as table format (user interaction). It also skips the check when in debug mode, but there might be use cases were it runs without TTY and the this behaviour is not desired. We should only check for newer versions when using --version or version command in that case.
Problem
When running Kosli CLI as part of the CI pipeline sometimes
stdErrandstdOutare multiplexed, e.g. Docker, GHA, etc. and writing tostdErrmight pollute the output and break the workflow depending or parsing that output.Proposed approach
Following the discussion in Slack the solution might be to detect when there is no TTY and ignore printing to
stdErr. This approach would need to ensure all the output going forstdErris silently dropped/ignored and onlystdOutis printed out.Context
We recently introduced checking ofr latest version which prints out a notice when not running the latest CLI. It outputs to
stdErronly when not outputting astableformat (user interaction). It also skips the check when in debug mode, but there might be use cases were it runs without TTY and the this behaviour is not desired. We should only check for newer versions when using--versionorversioncommand in that case.