python-broadlink icon indicating copy to clipboard operation
python-broadlink copied to clipboard

broadlink_cli: Error/Status messages should go to stderr

Open bengtmartensson opened this issue 2 years ago • 1 comments

It is common programming to write produced data to stdout while error and status messags go to stderr. That way, stdout can be used directly: for example redirecting to a file, or piped to another program. For example, to "learn" an IR signal and decode it on the fly,

./broadlink_cli --device @device --learn --durations | irptransmogrifier decode --input -

Presently, there are several commands like print("Learning...") that soil the output.

Suggestion: change to writing on stderr. (That would also make the --learnfile option (more or less) superflous).

bengtmartensson avatar Jan 19 '23 12:01 bengtmartensson

I think it's a good idea.

felipediel avatar Jan 21 '23 20:01 felipediel