* remove declarations of various string functions which allows
[findutils.git] / xargs / xargs.c
blobce814153dde53d1855e2dbc2e59d2995a129c12b
1 /* xargs -- build and execute command lines from standard input
2 Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18 /* Written by Mike Rendell <michael@cs.mun.ca>
19 and David MacKenzie <djm@gnu.ai.mit.edu>. */
21 #include <config.h>
23 #if __STDC__
24 #define P_(s) s
25 #else
26 #define P_(s) ()
27 #endif
29 #define _GNU_SOURCE
30 #include <ctype.h>
32 #if !defined (isascii) || defined (STDC_HEADERS)
33 #ifdef isascii
34 #undef isascii
35 #endif
36 #define isascii(c) 1
37 #endif
39 #ifdef isblank
40 #define ISBLANK(c) (isascii (c) && isblank (c))
41 #else
42 #define ISBLANK(c) ((c) == ' ' || (c) == '\t')
43 #endif
45 #define ISSPACE(c) (ISBLANK (c) || (c) == '\n' || (c) == '\r' \
46 || (c) == '\f' || (c) == '\v')
48 #include <sys/types.h>
49 #include <stdio.h>
50 #include <errno.h>
51 #include <getopt.h>
53 #if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
54 #include <string.h>
55 #if !defined(STDC_HEADERS)
56 #include <memory.h>
57 #endif
58 #else
59 #include <strings.h>
60 #define memcpy(dest, source, count) (bcopy((source), (dest), (count)))
61 #endif
63 #ifndef _POSIX_SOURCE
64 #include <sys/param.h>
65 #endif
67 #ifdef HAVE_LIMITS_H
68 #include <limits.h>
69 #endif
71 #ifdef HAVE_UNISTD_H
72 #include <unistd.h>
73 #endif
75 #include <signal.h>
77 #if !defined(SIGCHLD) && defined(SIGCLD)
78 #define SIGCHLD SIGCLD
79 #endif
81 /* COMPAT: SYSV version defaults size (and has a max value of) to 470.
82 We try to make it as large as possible. */
83 #if !defined(ARG_MAX) && defined(_SC_ARG_MAX)
84 #define ARG_MAX sysconf (_SC_ARG_MAX)
85 #endif
86 #ifndef ARG_MAX
87 #define ARG_MAX NCARGS
88 #endif
90 #include "wait.h"
92 /* States for read_line. */
93 #define NORM 0
94 #define SPACE 1
95 #define QUOTE 2
96 #define BACKSLASH 3
98 #ifdef STDC_HEADERS
99 #include <stdlib.h>
100 #else
101 char *malloc ();
102 void exit ();
103 void free ();
104 long strtol ();
106 extern int errno;
107 #endif
109 /* Return nonzero if S is the EOF string. */
110 #define EOF_STR(s) (eof_str && *eof_str == *s && !strcmp (eof_str, s))
112 extern char **environ;
114 /* Not char because of type promotion; NeXT gcc can't handle it. */
115 typedef int boolean;
116 #define true 1
117 #define false 0
119 #if __STDC__
120 #define VOID void
121 #else
122 #define VOID char
123 #endif
125 VOID *xmalloc P_ ((size_t n));
126 VOID *xrealloc P_ ((VOID * p, size_t n));
127 void error P_ ((int status, int errnum, char *message,...));
129 extern char *version_string;
131 /* The name this program was run with. */
132 char *program_name;
134 /* Buffer for reading arguments from stdin. */
135 static char *linebuf;
137 /* Line number in stdin since the last command was executed. */
138 static int lineno = 0;
140 /* If nonzero, then instead of putting the args from stdin at
141 the end of the command argument list, they are each stuck into the
142 initial args, replacing each occurrence of the `replace_pat' in the
143 initial args. */
144 static char *replace_pat = NULL;
146 /* The length of `replace_pat'. */
147 static size_t rplen = 0;
149 /* If nonzero, when this string is read on stdin it is treated as
150 end of file.
151 I don't like this - it should default to NULL. */
152 static char *eof_str = "_";
154 /* If nonzero, the maximum number of nonblank lines from stdin to use
155 per command line. */
156 static long lines_per_exec = 0;
158 /* The maximum number of arguments to use per command line. */
159 static long args_per_exec = 1024;
161 /* If true, exit if lines_per_exec or args_per_exec is exceeded. */
162 static boolean exit_if_size_exceeded = false;
164 /* The maximum number of characters that can be used per command line. */
165 static long arg_max;
167 /* Storage for elements of `cmd_argv'. */
168 static char *argbuf;
170 /* The list of args being built. */
171 static char **cmd_argv = NULL;
173 /* Number of elements allocated for `cmd_argv'. */
174 static int cmd_argv_alloc = 0;
176 /* Number of valid elements in `cmd_argv'. */
177 static int cmd_argc = 0;
179 /* Number of chars being used in `cmd_argv'. */
180 static int cmd_argv_chars = 0;
182 /* Number of initial arguments given on the command line. */
183 static int initial_argc = 0;
185 /* Number of chars in the initial args. */
186 static int initial_argv_chars = 0;
188 /* true when building up initial arguments in `cmd_argv'. */
189 static boolean initial_args = true;
191 /* If nonzero, the maximum number of child processes that can be running
192 at once. */
193 static int proc_max = 1;
195 /* Total number of child processes that have been executed. */
196 static int procs_executed = 0;
198 /* The number of elements in `pids'. */
199 static int procs_executing = 0;
201 /* List of child processes currently executing. */
202 static pid_t *pids = NULL;
204 /* The number of allocated elements in `pids'. */
205 static int pids_alloc = 0;
207 /* Exit status; nonzero if any child process exited with a
208 status of 1-125. */
209 static int child_error = 0;
211 /* If true, print each command on stderr before executing it. */
212 static boolean print_command = false;
214 /* If true, query the user before executing each command, and only
215 execute the command if the user responds affirmatively. */
216 static boolean query_before_executing = false;
218 static struct option const longopts[] =
220 {"null", no_argument, NULL, '0'},
221 {"eof", optional_argument, NULL, 'e'},
222 {"replace", optional_argument, NULL, 'i'},
223 {"max-lines", optional_argument, NULL, 'l'},
224 {"max-args", required_argument, NULL, 'n'},
225 {"interactive", no_argument, NULL, 'p'},
226 {"no-run-if-empty", no_argument, NULL, 'r'},
227 {"max-chars", required_argument, NULL, 's'},
228 {"verbose", no_argument, NULL, 't'},
229 {"exit", no_argument, NULL, 'x'},
230 {"max-procs", required_argument, NULL, 'P'},
231 {"version", no_argument, NULL, 'v'},
232 {"help", no_argument, NULL, 'h'},
233 {NULL, no_argument, NULL, 0}
236 static int read_line P_ ((void));
237 static int read_string P_ ((void));
238 static void do_insert P_ ((char *arg, size_t arglen, size_t lblen));
239 static void push_arg P_ ((char *arg, size_t len));
240 static boolean print_args P_ ((boolean ask));
241 static void do_exec P_ ((void));
242 static void add_proc P_ ((pid_t pid));
243 static void wait_for_proc P_ ((boolean all));
244 static long parse_num P_ ((char *str, int option, long min, long max));
245 static long env_size P_ ((char **envp));
246 static void usage P_ ((FILE * stream, int status));
248 void
249 main (argc, argv)
250 int argc;
251 char **argv;
253 int optc;
254 int always_run_command = 1;
255 long orig_arg_max;
256 char *default_cmd = "/bin/echo";
257 int (*read_args) P_ ((void)) = read_line;
259 program_name = argv[0];
261 orig_arg_max = ARG_MAX - 2048; /* POSIX.2 requires subtracting 2048. */
262 arg_max = orig_arg_max;
264 /* Sanity check for systems with huge ARG_MAX defines (e.g., Suns which
265 have it at 1 meg). Things will work fine with a large ARG_MAX but it
266 will probably hurt the system more than it needs to; an array of this
267 size is allocated. */
268 if (arg_max > 20 * 1024)
269 arg_max = 20 * 1024;
271 /* Take the size of the environment into account. */
272 arg_max -= env_size (environ);
273 if (arg_max <= 0)
274 error (1, 0, "environment is too large for exec");
276 while ((optc = getopt_long (argc, argv, "+0e::i::l::n:prs:txP:",
277 longopts, (int *) 0)) != -1)
279 switch (optc)
281 case '0':
282 read_args = read_string;
283 break;
285 case 'e':
286 if (optarg)
287 eof_str = optarg;
288 else
289 eof_str = 0;
290 break;
292 case 'h':
293 usage (stdout, 0);
295 case 'i':
296 if (optarg)
297 replace_pat = optarg;
298 else
299 replace_pat = "{}";
300 /* -i excludes -n -l. */
301 args_per_exec = 0;
302 lines_per_exec = 0;
303 break;
305 case 'l':
306 if (optarg)
307 lines_per_exec = parse_num (optarg, 'l', 1L, -1L);
308 else
309 lines_per_exec = 1;
310 /* -l excludes -i -n. */
311 args_per_exec = 0;
312 replace_pat = NULL;
313 break;
315 case 'n':
316 args_per_exec = parse_num (optarg, 'n', 1L, -1L);
317 /* -n excludes -i -l. */
318 lines_per_exec = 0;
319 replace_pat = NULL;
320 break;
322 case 's':
323 arg_max = parse_num (optarg, 's', 1L, orig_arg_max);
324 break;
326 case 't':
327 print_command = true;
328 break;
330 case 'x':
331 exit_if_size_exceeded = true;
332 break;
334 case 'p':
335 query_before_executing = true;
336 print_command = true;
337 break;
339 case 'r':
340 always_run_command = 0;
341 break;
343 case 'P':
344 proc_max = parse_num (optarg, 'P', 0L, -1L);
345 break;
347 case 'v':
348 printf ("GNU xargs version %s\n", version_string);
349 exit (0);
351 default:
352 usage (stderr, 1);
356 if (replace_pat || lines_per_exec)
357 exit_if_size_exceeded = true;
359 if (optind == argc)
361 optind = 0;
362 argc = 1;
363 argv = &default_cmd;
366 linebuf = (char *) xmalloc (arg_max + 1);
367 argbuf = (char *) xmalloc (arg_max + 1);
369 /* Make sure to listen for the kids. */
370 signal (SIGCHLD, SIG_DFL);
372 if (!replace_pat)
374 for (; optind < argc; optind++)
375 push_arg (argv[optind], strlen (argv[optind]) + 1);
376 initial_args = false;
377 initial_argc = cmd_argc;
378 initial_argv_chars = cmd_argv_chars;
380 while ((*read_args) () != -1)
381 if (lines_per_exec && lineno >= lines_per_exec)
383 do_exec ();
384 lineno = 0;
387 /* SYSV xargs seems to do at least one exec, even if the
388 input is empty. */
389 if (cmd_argc != initial_argc
390 || (always_run_command && procs_executed == 0))
391 do_exec ();
393 else
395 int i;
396 size_t len;
397 size_t *arglen = (size_t *) xmalloc (sizeof (size_t) * argc);
399 for (i = optind; i < argc; i++)
400 arglen[i] = strlen(argv[i]);
401 rplen = strlen (replace_pat);
402 while ((len = (*read_args) ()) != -1)
404 /* Don't do insert on the command name. */
405 push_arg (argv[optind], arglen[optind] + 1);
406 len--;
407 for (i = optind + 1; i < argc; i++)
408 do_insert (argv[i], arglen[i], len);
409 do_exec ();
413 wait_for_proc (true);
414 exit (child_error);
417 /* Read a line of arguments from stdin and add them to the list of
418 arguments to pass to the command. Ignore blank lines and initial blanks.
419 Single and double quotes and backslashes quote metacharacters and blanks
420 as they do in the shell.
421 Return -1 if eof (either physical or logical) is reached,
422 otherwise the length of the last string read (including the null). */
424 static int
425 read_line ()
427 static boolean eof = false;
428 /* Start out in mode SPACE to always strip leading spaces (even with -i). */
429 int state = SPACE; /* The type of character we last read. */
430 int prevc; /* The previous value of c. */
431 int quotc = 0; /* The last quote character read. */
432 int c = EOF;
433 boolean first = true; /* true if reading first arg on line. */
434 int len;
435 char *p = linebuf;
436 /* Including the NUL, the args must not grow past this point. */
437 char *endbuf = linebuf + arg_max - initial_argv_chars - 1;
439 if (eof)
440 return -1;
441 while (1)
443 prevc = c;
444 c = getc (stdin);
445 if (c == EOF)
447 /* COMPAT: SYSV seems to ignore stuff on a line that
448 ends without a \n; we don't. */
449 eof = true;
450 if (p == linebuf)
451 return -1;
452 *p++ = '\0';
453 len = p - linebuf;
454 /* FIXME we don't check for unterminated quotes here. */
455 if (first && EOF_STR (linebuf))
456 return -1;
457 if (!replace_pat)
458 push_arg (linebuf, len);
459 return len;
461 switch (state)
463 case SPACE:
464 if (ISSPACE (c))
465 continue;
466 state = NORM;
467 /* aaahhhh.... */
469 case NORM:
470 if (c == '\n')
472 if (!ISBLANK (prevc))
473 lineno++; /* For -l. */
474 if (p == linebuf)
476 /* Blank line. */
477 state = SPACE;
478 continue;
480 *p++ = '\0';
481 len = p - linebuf;
482 if (EOF_STR (linebuf))
484 eof = true;
485 return first ? -1 : len;
487 if (!replace_pat)
488 push_arg (linebuf, len);
489 return len;
491 if (!replace_pat && ISSPACE (c))
493 *p++ = '\0';
494 len = p - linebuf;
495 if (EOF_STR (linebuf))
497 eof = true;
498 return first ? -1 : len;
500 push_arg (linebuf, len);
501 p = linebuf;
502 state = SPACE;
503 first = false;
504 continue;
506 switch (c)
508 case '\\':
509 state = BACKSLASH;
510 continue;
512 case '\'':
513 case '"':
514 state = QUOTE;
515 quotc = c;
516 continue;
518 break;
520 case QUOTE:
521 if (c == '\n')
522 error (1, 0, "unmatched %s quote",
523 quotc == '"' ? "double" : "single");
524 if (c == quotc)
526 state = NORM;
527 continue;
529 break;
531 case BACKSLASH:
532 state = NORM;
533 break;
535 if (p >= endbuf)
536 error (1, 0, "argument line too long");
537 *p++ = c;
541 /* Read a null-terminated string from stdin and add it to the list of
542 arguments to pass to the command.
543 Return -1 if eof (either physical or logical) is reached,
544 otherwise the length of the string read (including the null). */
546 static int
547 read_string ()
549 static boolean eof = false;
550 int len;
551 char *p = linebuf;
552 /* Including the NUL, the args must not grow past this point. */
553 char *endbuf = linebuf + arg_max - initial_argv_chars - 1;
555 if (eof)
556 return -1;
557 while (1)
559 int c = getc (stdin);
560 if (c == EOF)
562 eof = true;
563 if (p == linebuf)
564 return -1;
565 *p++ = '\0';
566 len = p - linebuf;
567 if (!replace_pat)
568 push_arg (linebuf, len);
569 return len;
571 if (c == '\0')
573 lineno++; /* For -l. */
574 *p++ = '\0';
575 len = p - linebuf;
576 if (!replace_pat)
577 push_arg (linebuf, len);
578 return len;
580 if (p >= endbuf)
581 error (1, 0, "argument line too long");
582 *p++ = c;
586 /* Replace all instances of `replace_pat' in ARG with `linebuf',
587 and add the resulting string to the list of arguments for the command
588 to execute.
589 ARGLEN is the length of ARG, not including the null.
590 LBLEN is the length of `linebuf', not including the null.
592 COMPAT: insertions on the SYSV version are limited to 255 chars per line,
593 and a max of 5 occurences of replace_pat in the initial-arguments.
594 Those restrictions do not exist here. */
596 static void
597 do_insert (arg, arglen, lblen)
598 char *arg;
599 size_t arglen;
600 size_t lblen;
602 /* Temporary copy of each arg with the replace pattern replaced by the
603 real arg. */
604 static char *insertbuf;
605 char *p;
606 int bytes_left = arg_max - 1; /* Bytes left on the command line. */
608 if (!insertbuf)
609 insertbuf = (char *) xmalloc (arg_max + 1);
610 p = insertbuf;
614 size_t len; /* Length in ARG before `replace_pat'. */
615 char *s = strstr (arg, replace_pat);
616 if (s)
617 len = s - arg;
618 else
619 len = arglen;
620 bytes_left -= len;
621 if (bytes_left <= 0)
622 break;
624 strncpy (p, arg, len);
625 p += len;
626 arg += len;
627 arglen -= len;
629 if (s)
631 bytes_left -= lblen;
632 if (bytes_left <= 0)
633 break;
634 strcpy (p, linebuf);
635 arg += rplen;
636 arglen -= rplen;
637 p += lblen;
640 while (*arg);
641 if (*arg)
642 error (1, 0, "command too long");
643 *p++ = '\0';
644 push_arg (insertbuf, p - insertbuf);
647 /* Add ARG to the end of the list of arguments `cmd_argv' to pass
648 to the command.
649 LEN is the length of ARG, including the terminating null.
650 If this brings the list up to its maximum size, execute the command. */
652 static void
653 push_arg (arg, len)
654 char *arg;
655 size_t len;
657 if (arg)
659 if (cmd_argv_chars + len > arg_max)
661 if (initial_args || cmd_argc == initial_argc)
662 error (1, 0, "can not fit single argument within argument list size limit");
663 if (replace_pat
664 || (exit_if_size_exceeded &&
665 (lines_per_exec || args_per_exec)))
666 error (1, 0, "argument list too long");
667 do_exec ();
669 if (!initial_args && args_per_exec &&
670 cmd_argc - initial_argc == args_per_exec)
671 do_exec ();
674 if (cmd_argc >= cmd_argv_alloc)
676 if (!cmd_argv)
678 cmd_argv_alloc = 64;
679 cmd_argv = (char **) xmalloc (sizeof (char *) * cmd_argv_alloc);
681 else
683 cmd_argv_alloc *= 2;
684 cmd_argv = (char **) xrealloc (cmd_argv,
685 sizeof (char *) * cmd_argv_alloc);
689 if (!arg)
690 cmd_argv[cmd_argc++] = NULL;
691 else
693 cmd_argv[cmd_argc++] = argbuf + cmd_argv_chars;
694 strcpy (argbuf + cmd_argv_chars, arg);
695 cmd_argv_chars += len;
699 /* Print the arguments of the command to execute.
700 If ASK is nonzero, prompt the user for a response, and
701 if the user responds affirmatively, return true;
702 otherwise, return false. */
704 static boolean
705 print_args (ask)
706 boolean ask;
708 int i;
710 for (i = 0; i < cmd_argc - 1; i++)
711 fprintf (stderr, "%s ", cmd_argv[i]);
712 if (ask)
714 static FILE *tty_stream;
715 int c, savec;
717 if (!tty_stream)
719 tty_stream = fopen ("/dev/tty", "r");
720 if (!tty_stream)
721 error (1, errno, "/dev/tty");
723 fputs ("?...", stderr);
724 fflush (stderr);
725 c = savec = getc (tty_stream);
726 while (c != EOF && c != '\n')
727 c = getc (tty_stream);
728 if (savec == 'y' || savec == 'Y')
729 return true;
731 else
732 putc ('\n', stderr);
734 return false;
737 /* Execute the command that has been built in `cmd_argv'. This may involve
738 waiting for processes that were previously executed. */
740 static void
741 do_exec ()
743 pid_t child;
745 push_arg ((char *) NULL, 0); /* Null terminate the arg list. */
746 if (!query_before_executing || print_args (true))
748 if (proc_max && procs_executing >= proc_max)
749 wait_for_proc (false);
750 if (!query_before_executing && print_command)
751 print_args (false);
752 /* If we run out of processes, wait for a child to return and
753 try again. */
754 while ((child = fork ()) < 0 && errno == EAGAIN && procs_executing)
755 wait_for_proc (false);
756 switch (child)
758 case -1:
759 error (1, errno, "cannot fork");
761 case 0: /* Child. */
762 execvp (cmd_argv[0], cmd_argv);
763 error (0, errno, "%s", cmd_argv[0]);
764 _exit (errno == ENOENT ? 127 : 126);
766 add_proc (child);
769 cmd_argc = initial_argc;
770 cmd_argv_chars = initial_argv_chars;
773 /* Add the process with id PID to the list of processes that have
774 been executed. */
776 static void
777 add_proc (pid)
778 pid_t pid;
780 int i;
782 /* Find an empty slot. */
783 for (i = 0; i < pids_alloc && pids[i]; i++)
785 if (i == pids_alloc)
787 if (pids_alloc == 0)
789 pids_alloc = proc_max ? proc_max : 64;
790 pids = (pid_t *) xmalloc (sizeof (pid_t) * pids_alloc);
792 else
794 pids_alloc *= 2;
795 pids = (pid_t *) xrealloc (pids,
796 sizeof (pid_t) * pids_alloc);
798 memset (&pids[i], '\0', sizeof (pid_t) * (pids_alloc - i));
800 pids[i] = pid;
801 procs_executing++;
802 procs_executed++;
805 /* If ALL is true, wait for all child processes to finish;
806 otherwise, wait for one child process to finish.
807 Remove the processes that finish from the list of executing processes. */
809 static void
810 wait_for_proc (all)
811 boolean all;
813 while (procs_executing)
815 int i, status;
819 pid_t pid;
821 pid = wait (&status);
822 if (pid < 0)
823 error (1, errno, "error waiting for child process");
825 /* Find the entry in `pids' for the child process
826 that exited. */
827 for (i = 0; i < pids_alloc && pid != pids[i]; i++)
830 while (i == pids_alloc); /* A child died that we didn't start? */
832 /* Remove the child from the list. */
833 pids[i] = 0;
834 procs_executing--;
836 if (WEXITSTATUS (status) == 126 || WEXITSTATUS (status) == 127)
837 exit (WEXITSTATUS (status)); /* Can't find or run the command. */
838 if (WEXITSTATUS (status) == 255)
839 error (124, 0, "%s: exited with status 255; aborting", cmd_argv[0]);
840 if (WIFSTOPPED (status))
841 error (125, 0, "%s: stopped by signal %d", cmd_argv[0], WSTOPSIG (status));
842 if (WIFSIGNALED (status))
843 error (125, 0, "%s: terminated by signal %d", cmd_argv[0], WTERMSIG (status));
844 if (WEXITSTATUS (status) != 0)
845 child_error = 123;
847 if (!all)
848 break;
852 /* Return the value of the number represented in STR.
853 OPTION is the command line option to which STR is the argument.
854 If the value does not fall within the boundaries MIN and MAX,
855 Print an error message mentioning OPTION and exit. */
857 static long
858 parse_num (str, option, min, max)
859 char *str;
860 int option;
861 long min;
862 long max;
864 char *eptr;
865 long val;
867 val = strtol (str, &eptr, 10);
868 if (eptr == str || *eptr)
870 fprintf (stderr, "%s: invalid number for -%c option\n",
871 program_name, option);
872 usage (stderr, 1);
874 else if (val < min)
876 fprintf (stderr, "%s: value for -%c option must be >= %ld\n",
877 program_name, option, min);
878 usage (stderr, 1);
880 else if (max >= 0 && val > max)
882 fprintf (stderr, "%s: value for -%c option must be < %ld\n",
883 program_name, option, max);
884 usage (stderr, 1);
886 return val;
889 /* Return how much of ARG_MAX is used by the environment. */
891 static long
892 env_size (envp)
893 char **envp;
895 long len = 0;
897 while (*envp)
898 len += strlen (*envp++) + 1;
900 return len;
903 static void
904 usage (stream, status)
905 FILE *stream;
906 int status;
908 fprintf (stream, "\
909 Usage: %s [-0prtx] [-e[eof-str]] [-i[replace-str]] [-l[max-lines]]\n\
910 [-n max-args] [-s max-chars] [-P max-procs] [--null] [--eof[=eof-str]]\n\
911 [--replace[=replace-str]] [--max-lines[=max-lines]] [--interactive]\n\
912 [--max-chars=max-chars] [--verbose] [--exit] [--max-procs=max-procs]\n\
913 [--max-args=max-args] [--no-run-if-empty] [--version] [--help]\n\
914 [command [initial-arguments]]\n",
915 program_name);
916 exit (status);