Added usage prompt to flash utility
authorNed Konz <ned@productcreationstudio.com>
Thu, 20 Oct 2011 01:55:56 +0000 (18:55 -0700)
committerNed Konz <ned@productcreationstudio.com>
Thu, 20 Oct 2011 01:55:56 +0000 (18:55 -0700)
flash/main.c

index 0fd7232b9916d58c1bed823b48ed70e004afa289..a443f95f6bb58b59460e3231a5a650d637763d6c 100644 (file)
@@ -17,6 +17,11 @@ struct opts
   size_t size;
 };
 
+static void usage(void)
+{
+    puts("stlinkv1 command line: ./flash {read|write} /dev/sgX path addr <size>");
+    puts("stlinkv2 command line: ./flash {read|write} path addr <size>");
+}
 
 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;
   }