1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Added commandline option --quiet

Suppress picocom from printing initial greetings banners and other
messages not explicitly requested by the user. Command responses and
errors or warnings are still printed.
This commit is contained in:
Nick Patavalis
2017-12-14 18:44:44 +02:00
parent 2d075e971e
commit 6fdd2a3084
4 changed files with 47 additions and 8 deletions

20
fdio.c
View File

@ -67,6 +67,26 @@ fd_printf (int fd, const char *format, ...)
return writen_ni(fd, buf, len);
}
int
fd_pinfof(int quiet, const char *format, ...)
{
char buf[256];
va_list args;
int len;
if ( quiet ) {
return 0;
}
va_start(args, format);
len = vsnprintf(buf, sizeof(buf), format, args);
buf[sizeof(buf) - 1] = '\0';
va_end(args);
return writen_ni(STDOUT_FILENO, buf, len);
}
/**********************************************************************/
#ifndef LINENOISE