From: Ned Konz Date: Thu, 20 Oct 2011 01:55:56 +0000 (-0700) Subject: Added usage prompt to flash utility X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=152989ba1c2cd61620f18d145b805e75adc1ef2a;hp=f10d08b4a5eeb253407f06f9ffba7ef87ab6ac91;p=fw%2Fstlink Added usage prompt to flash utility --- 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; }