1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-07 16:35:33 +02:00

conf, log: On -h / --help, print usage to stdout, not stderr

Erik suggests that this makes it easier to grep for options, and with
--help we're anyway printing usage information as expected, not as
part of an error report.

While at it: on -h, we should exit with 0.

Reported-by: Erik Sjölund <erik.sjolund@gmail.com>
Link: https://bugs.passt.top/show_bug.cgi?id=52
Link: https://bugs.passt.top/show_bug.cgi?id=53
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Stefano Brivio 2023-06-04 07:14:49 +02:00
parent d072ac2434
commit 3c6d1b9bb2
3 changed files with 24 additions and 8 deletions

1
log.h
View file

@ -22,6 +22,7 @@ void debug(const char *format, ...);
} while (0)
extern int log_trace;
extern int log_to_stdout;
void trace_init(int enable);
#define trace(...) \
do { \