| 81 | } |
| 82 | |
| 83 | void |
| 84 | usage (int status) |
| 85 | { |
| 86 | if (status != EXIT_SUCCESS) |
| 87 | emit_try_help (); |
| 88 | else |
| 89 | { |
| 90 | printf (_("Usage: %s OPTION... COMMAND\n"), program_name); |
| 91 | fputs (_("\ |
| 92 | Run COMMAND, with modified buffering operations for its standard streams.\n\ |
| 93 | "), stdout); |
| 94 | |
| 95 | emit_mandatory_arg_note (); |
| 96 | |
| 97 | oputs (_("\ |
| 98 | -i, --input=MODE adjust standard input stream buffering\n\ |
| 99 | ")); |
| 100 | oputs (_("\ |
| 101 | -o, --output=MODE adjust standard output stream buffering\n\ |
| 102 | ")); |
| 103 | oputs (_("\ |
| 104 | -e, --error=MODE adjust standard error stream buffering\n\ |
| 105 | ")); |
| 106 | oputs (HELP_OPTION_DESCRIPTION); |
| 107 | oputs (VERSION_OPTION_DESCRIPTION); |
| 108 | fputs (_("\n\ |
| 109 | If MODE is 'L' the corresponding stream will be line buffered.\n\ |
| 110 | This option is invalid with standard input.\n"), stdout); |
| 111 | fputs (_("\n\ |
| 112 | If MODE is '0' the corresponding stream will be unbuffered.\n\ |
| 113 | "), stdout); |
| 114 | fputs (_("\n\ |
| 115 | Otherwise MODE is a number which may be followed by one of the following:\n\ |
| 116 | KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G,T,P,E,Z,Y,R,Q.\n\ |
| 117 | Binary prefixes can be used, too: KiB=K, MiB=M, and so on.\n\ |
| 118 | In this case the corresponding stream will be fully buffered with the buffer\n\ |
| 119 | size set to MODE bytes.\n\ |
| 120 | "), stdout); |
| 121 | fputs (_("\n\ |
| 122 | NOTE: If COMMAND adjusts the buffering of its standard streams ('tee' does\n\ |
| 123 | for example) then that will override corresponding changes by 'stdbuf'.\n\ |
| 124 | Also some filters (like 'dd' and 'cat' etc.) don't use streams for I/O,\n\ |
| 125 | and are thus unaffected by 'stdbuf' settings.\n\ |
| 126 | "), stdout); |
| 127 | emit_exec_status (PROGRAM_NAME); |
| 128 | emit_ancillary_info (PROGRAM_NAME); |
| 129 | } |
| 130 | exit (status); |
| 131 | } |
| 132 | |
| 133 | /* argv[0] can be anything really, but generally it contains |
| 134 | the path to the executable or just a name if it was executed |
no test coverage detected