diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2016-06-06 10:58:56 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2016-09-15 14:48:04 -0700 |
commit | f1f9deae881714c4cf1bdd62a61d5d4446a6359a (patch) | |
tree | 34e63fd010ce99ef5012e93cd9ef59c6f10102cb | |
parent | c51b60b129600c6dd7ef9002b69c1c1daeeedcc6 (diff) | |
download | wayland-f1f9deae881714c4cf1bdd62a61d5d4446a6359a.tar.gz |
scanner: Fix reported executable name to 'wayland-scanner'
'wayland-scanner -v' (correctly) reports the program as named
"wayland-scanner", but 'wayland-scanner -h' was inconsistent, referring
to it as './scanner'.
Also refactor this and other references to the program name to use a
common #define, PROGRAM_NAME.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
-rw-r--r-- | src/scanner.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/scanner.c b/src/scanner.c index 479e22b..bd2d116 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -42,6 +42,8 @@ #if HAVE_LIBXML #include <libxml/parser.h> +#define PROGRAM_NAME "wayland-scanner" + /* Embedded wayland.dtd file, see dtddata.S */ extern char DTD_DATA_begin; extern int DTD_DATA_len; @@ -59,8 +61,8 @@ enum side { static int usage(int ret) { - fprintf(stderr, "usage: ./scanner [OPTION] [client-header|server-header|code]" - " [input_file output_file]\n"); + fprintf(stderr, "usage: %s [OPTION] [client-header|server-header|code]" + " [input_file output_file]\n", PROGRAM_NAME); fprintf(stderr, "\n"); fprintf(stderr, "Converts XML protocol descriptions supplied on " "stdin or input file to client\n" @@ -78,7 +80,7 @@ usage(int ret) static int scanner_version(int ret) { - fprintf(stderr, "wayland-scanner %s\n", WAYLAND_VERSION); + fprintf(stderr, "%s %s\n", PROGRAM_NAME, WAYLAND_VERSION); exit(ret); } @@ -238,7 +240,7 @@ static void * fail_on_null(void *p) { if (p == NULL) { - fprintf(stderr, "wayland-scanner: out of memory\n"); + fprintf(stderr, "%s: out of memory\n", PROGRAM_NAME); exit(EXIT_FAILURE); } @@ -1469,7 +1471,7 @@ emit_header(struct protocol *protocol, enum side side) const char *s = (side == SERVER) ? "SERVER" : "CLIENT"; char **p, *prev; - printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION); + printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION); printf("#ifndef %s_%s_PROTOCOL_H\n" "#define %s_%s_PROTOCOL_H\n" @@ -1672,7 +1674,7 @@ emit_code(struct protocol *protocol) struct wl_array types; char **p, *prev; - printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION); + printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION); if (protocol->copyright) format_text_to_comment(protocol->copyright, true); |