add "-h" for help
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 14 Feb 2008 12:26:29 +0000 (12:26 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 14 Feb 2008 12:26:29 +0000 (12:26 +0000)
tools/mergesolv.c

index 14a466a..f770fbd 100644 (file)
 #include "repo_solv.h"
 #include "common_write.h"
 
+static void
+usage()
+{
+  fprintf(stderr, "\nUsage:\n"
+         "mergesolv [file] [file] [...]\n"
+         "  merges multiple solv files into one and writes it to stdout\n"
+         );
+  exit(0);
+}
+
+
 int
 main(int argc, char **argv)
 {
@@ -33,6 +44,8 @@ main(int argc, char **argv)
     {
       FILE *fp;
       argv++;
+      if (!strcmp(*argv,"-h"))
+       usage();
       if ((fp = fopen(*argv, "r")) == NULL)
        {
          perror(argv[1]);