From 152989ba1c2cd61620f18d145b805e75adc1ef2a Mon Sep 17 00:00:00 2001 From: Ned Konz Date: Wed, 19 Oct 2011 18:55:56 -0700 Subject: [PATCH] Added usage prompt to flash utility --- flash/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flash/main.c b/flash/main.c index 0fd7232..a443f95 100644 --- a/flash/main.c +++ b/flash/main.c @@ -17,6 +17,11 @@ struct opts size_t size; }; +static void usage(void) +{ + puts("stlinkv1 command line: ./flash {read|write} /dev/sgX path addr "); + puts("stlinkv2 command line: ./flash {read|write} path addr "); +} static int get_opts(struct opts* o, int ac, char** av) { @@ -75,6 +80,7 @@ int main(int ac, char** av) if (get_opts(&o, ac - 1, av + 1) == -1) { printf("invalid command line\n"); + usage(); goto on_error; } -- 2.30.2