diff options
author | Jim Meyering <jim@meyering.net> | 2002-07-22 12:24:41 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-07-22 12:24:41 +0000 |
commit | 2bd28f020002a4997928acf2a4874427114b970e (patch) | |
tree | b2ebd6042c81a0e87aa27a2b2a4b307402a51ae6 /src/rm.c | |
parent | 48a269db9c9278cebdd2c2d59a2ce570d400d89c (diff) | |
download | coreutils-2bd28f020002a4997928acf2a4874427114b970e.tar.gz |
Add new option, --presume-input-tty, for testing only.
Not documented.
Diffstat (limited to 'src/rm.c')
-rw-r--r-- | src/rm.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -63,11 +63,25 @@ /* Name this program was run with. */ char *program_name; +/* For long options that have no equivalent short option, use a + non-character as a pseudo short option, starting with CHAR_MAX + 1. */ +enum +{ + PRESUME_INPUT_TTY_OPTION = CHAR_MAX + 1 +}; + static struct option const long_opts[] = { {"directory", no_argument, NULL, 'd'}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, + + /* This is solely for testing. Do not document. */ + /* It is relatively difficult to ensure that there is a tty on stdin. + Since rm acts differently depending on that, without this option, + it'd be harder to test the parts of rm that depend on that setting. */ + {"presume-input-tty", no_argument, NULL, PRESUME_INPUT_TTY_OPTION}, + {"recursive", no_argument, NULL, 'r'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -164,6 +178,9 @@ main (int argc, char **argv) case 'R': x.recursive = 1; break; + case PRESUME_INPUT_TTY_OPTION: + x.stdin_tty = 1; + break; case 'v': x.verbose = 1; break; |