diff options
Diffstat (limited to 'src/paste.c')
-rw-r--r-- | src/paste.c | 32 |
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); } |