Commit f53189c5 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Andrei Vagin

compel cli: print usage to stderr in case of error

This is mainly dictated by the fact that we use stdout
from "compel *flags" in a special way, so it should not
be garbled by the usage info.

Otherwise, for example, the following code in Makefile

	CFLAGS += $(shell compel --badopt cflags)

will lead to the whole usage() output to be added to compiler flags,
which looks really really weird.

travis-ci: success for More polishing for compel cli
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent dfee3232
......@@ -110,7 +110,9 @@ static void cli_log(unsigned int lvl, const char *fmt, va_list parms)
}
static int usage(int rc) {
printf(
FILE *out = (rc == 0) ? stdout : stderr;
fprintf(out,
"Usage:\n"
" compel [--compat] cflags | ldflags\n"
" compel -f FILE -o FILE -p NAME [-l N] hgen\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment