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:
20
fdio.c
20
fdio.c
@ -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
|
||||
|
Reference in New Issue
Block a user