I'm writing some unix-style Ruby scripts that take option flags. Normally, I write a lot of STDOUT.puts
and STDERR.puts
statments in these scripts. Now I'm wondering whether it's "good form" to put in --verbose
or -q
flags for switching on or off helpful output to STDERR.
Two arguments against doing that are that
- it would make the program more complex,
- users can already silence the logging output by redirecting STDERR to /dev/null
But then again, one of the tenets of the Unix Philosophy is that silence is golden, which implies that there should always be a --verbose mode flag. But doesn't this stand in tension with the tenet of making small programs that do one thing well?
And a second question would be: if silent/verbose flags are a good idea, should verbosity ever be the default?
Can some UNIX programming gurus please advise.