bracket bug address with <> and append a period
[platform/upstream/coreutils.git] / src / dircolors.c
index 68b85e6..405406f 100644 (file)
@@ -88,7 +88,9 @@ static struct option const long_options[] =
     {"csh", no_argument, NULL, 'c'},
     {"c-shell", no_argument, NULL, 'c'},
     {"help", no_argument, NULL, 'h'},
+    {"print-database", no_argument, NULL, 'p'},
     {"version", no_argument, NULL, 'v'},
+    {NULL, 0, NULL, 0}
   };
 
 char *program_name;
@@ -103,15 +105,20 @@ usage (int status)
     {
       printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name);
       printf (_("\
-      printf (_("\
-Output commands to set the LS_COLOR environment variable.\n\
+Output commands to set the LS_COLORS environment variable.\n\
 \n\
-  -h, --help                  display this help and exit\n\
-      --version               output version information and exit\n\
 Determine format of output:\n\
-  -p, --print-data-base       output defaults\n\
-  -b, --sh, --bourne-shell    output Bourne shell code to set LS_COLOR\n\
-  -c, --csh, --c-shell        output C shell code to set LS_COLOR\n"));
+  -b, --sh, --bourne-shell    output Bourne shell code to set LS_COLORS\n\
+  -c, --csh, --c-shell        output C shell code to set LS_COLORS\n\
+  -p, --print-database        output defaults\n\
+      --help                  display this help and exit\n\
+      --version               output version information and exit\n\
+\n\
+If FILE is specified, read it to determine which colors to use for which\n\
+file types and extensions.  Otherwise, a precompiled database is used.\n\
+For details on the format of these files, run `dircolors --print-database'.\n\
+"));
+      puts (_("\nReport bugs to <fileutils-bugs@gnu.ai.mit.edu>."));
     }
 
   exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -122,7 +129,7 @@ xstrndup (const char *s, size_t n)
 {
   char *new = strndup (s, n);
   if (new == NULL)
-    error (EXIT_FAILURE, 0, _("Memory exhausted"));
+    error (EXIT_FAILURE, 0, _("virtual memory exhausted"));
   return new;
 }
 
@@ -415,10 +422,9 @@ main (int argc, char **argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  parse_long_options (argc, argv, "dircolors", PACKAGE_VERSION, usage);
+  parse_long_options (argc, argv, "dircolors", GNU_PACKAGE, VERSION, usage);
 
-  while ((optc = getopt_long (argc, argv, "bcp", long_options, NULL))
-        != EOF)
+  while ((optc = getopt_long (argc, argv, "bcp", long_options, NULL)) != -1)
     switch (optc)
       {
       case 'b':        /* Bourne shell syntax.  */