Add '--quiet' comand line option to suppress some output

This commit is contained in:
Adon Shapiro
2017-03-24 14:16:10 -04:00
committed by Andrzej Rybczak
parent 5b7ea189ce
commit 7ba2c3534c
4 changed files with 20 additions and 1 deletions

View File

@@ -54,6 +54,7 @@ namespace {
std::ofstream errorlog;
std::streambuf *cerr_buffer;
std::streambuf *clog_buffer;
volatile bool run_resize_screen = false;
@@ -69,8 +70,9 @@ void sighandler(int sig)
void do_at_exit()
{
// restore old cerr buffer
// restore old cerr & clog buffers
std::cerr.rdbuf(cerr_buffer);
std::clog.rdbuf(clog_buffer);
errorlog.close();
Mpd.Disconnect();
NC::destroyScreen();
@@ -92,6 +94,9 @@ int main(int argc, char **argv)
std::setlocale(LC_ALL, "");
std::locale::global(Charset::internalLocale());
// clog might be overriden in configure, so preserve the original buffer.
clog_buffer = std::clog.rdbuf();
if (!configure(argc, argv))
return 0;