summaryrefslogtreecommitdiff
path: root/src/paste.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
committerJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
commitb869639f4661488eba0bb2d08020c6e71bb72627 (patch)
treee325845ec7ca06b4d59fcc07e87020897c7c4d9b /src/paste.c
parentd1df8c198d8878b77d1d1583bc7b3c491534616a (diff)
downloadcoreutils-b869639f4661488eba0bb2d08020c6e71bb72627.tar.xz
merge with 1.8d+
Diffstat (limited to 'src/paste.c')
-rw-r--r--src/paste.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/paste.c b/src/paste.c
index d4a0f9295..76f2d9c45 100644
--- a/src/paste.c
+++ b/src/paste.c
@@ -139,7 +139,7 @@ main (argc, argv)
break;
default:
- usage ();
+ usage (1);
}
}
@@ -150,7 +150,7 @@ main (argc, argv)
}
if (show_help)
- usage ();
+ usage (0);
if (optind == argc)
argv[argc++] = "-";
@@ -481,11 +481,27 @@ paste_serial (nfiles, fnamptr)
}
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "\
-Usage: %s [-s] [-d delim-list] [--serial] [--delimiters=delim-list]\n\
- [--help] [--version] [file...]\n",
- program_name);
- exit (1);
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
+Usage: %s [OPTION]... [FILE]...\n\
+",
+ program_name);
+ printf ("\
+\n\
+ -d, --delimiters LIST reuse characters from LIST instead of TABs\n\
+ -s, --serial paste one file at a time instead of in parallel\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+With no INPUT, or when INPUT is -, read standard input.\n\
+");
+ }
+ exit (status);
}