Skip to content

Commit b45269d

Browse files
authored
tee: '--' option terminator (#480)
* The following command works the same on Linux and OpenBSD: "tee -- -mylog" * The argument list contains one file called "-mylog"; it's not an option as it appears after '--' * Perl code has a custom option parser so it needs to handle '--' directly
1 parent f34b3a5 commit b45269d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bin/tee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ License: perl
1919

2020
while ($ARGV[0] =~ /^-(.+)/ && (shift, ($_ = $1), 1)) {
2121
next if /^$/;
22+
last if $_ eq '-'; # '--' terminator
2223
s/i// && (++$ignore_ints, redo);
2324
s/a// && (++$append, redo);
2425
s/u// && (++$unbuffer, redo);

0 commit comments

Comments
 (0)