aboutsummaryrefslogtreecommitdiffstats
path: root/hktool.c
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2017-05-18 23:11:27 +0100
committerTomasz Kramkowski <tk@the-tk.com>2017-05-18 23:11:27 +0100
commit83ad7ea3f3f6ab802987cf4a0e677e68c002cb29 (patch)
treebcebf3da17e9ede54aad7f6abcab6ecfadaeaa50 /hktool.c
parent3dc1f6c4aba4a382bc63342658910fbecb8e159d (diff)
downloadhktool-83ad7ea3f3f6ab802987cf4a0e677e68c002cb29.tar.gz
hktool-83ad7ea3f3f6ab802987cf4a0e677e68c002cb29.tar.xz
hktool-83ad7ea3f3f6ab802987cf4a0e677e68c002cb29.zip
hktool.c: replace USAGE macro with something less stupid
Diffstat (limited to 'hktool.c')
-rw-r--r--hktool.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hktool.c b/hktool.c
index 233f5c9..d46a851 100644
--- a/hktool.c
+++ b/hktool.c
@@ -32,7 +32,7 @@
#define VERSION "unknown version"
#endif
-#define USAGE "[-hlvr] [-f file] [--] mcu"
+static const char *usage = "[-hlvr] [-f file] [--] mcu";
static void help(void)
{
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
flashfile = optarg;
break;
case 'h':
- fprintf(stderr, "Usage: %s " USAGE "\n", argv[0]);
+ fprintf(stderr, "Usage: %s %s\n", argv[0], usage);
help();
return EXIT_SUCCESS;
break;
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
doreboot = true;
break;
case '?':
- fprintf(stderr, "Usage: %s " USAGE "\n", argv[0]);
+ fprintf(stderr, "Usage: %s %s\n", argv[0], usage);
return EXIT_FAILURE;
break;
default:
@@ -101,13 +101,13 @@ int main(int argc, char **argv)
}
if (optind >= argc)
- eprintf("No MCU specified\nUsage: %s " USAGE, argv[0]);
+ eprintf("No MCU specified\nUsage: %s %s", argv[0], usage);
if (!doflash && !doreboot)
eprintf("Nothing to do");
if (argc - optind > 1)
- eprintf("Invalid number of arguments\nUsage: %s " USAGE, argv[0]);
+ eprintf("Invalid number of arguments\nUsage: %s %s", argv[0], usage);
if (getparams(&fp, argv[optind]) != 0)
return EXIT_FAILURE;