rlaager / docsis

This program encodes a DOCSIS binary configuration file from a human-readable text configuration file.
http://docsis.sourceforge.net
GNU General Public License v2.0
114 stars 70 forks source link

Don't print to stderr if encoding succeeds #51

Closed nwidger closed 8 years ago

nwidger commented 8 years ago

It is usually considered bad form to print to stderr unless an error actually occured, and some scripting languages will consider a command to have failed if stderr isn't empty. This tool currently prints the following text to stderr when a modem configuration is successfully encoded:

$ docsis -e - delme keyfile delme2 > /dev/null
##### Calculating CMTS MIC using TLVs:
##### End of CMTS MIC TLVs
 --- MD5 DIGEST: 0xf90e368f5d979a2d5093bbaba37f1497
Final content of config file:

This PR changes these lines to instead print to stdout so that stderr is empty when the encoding succeeds.

rlaager commented 8 years ago

I think part of the point of this was to keep this separate from the actual output on stdout. This whole thing is a mess, though. This change helps fix the test suite for me, so I've accepted it.