Skip to content

Commit

Permalink
tee: '--' option terminator (#480)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mknos committed Mar 2, 2024
1 parent f34b3a5 commit b45269d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/tee
Expand Up @@ -19,6 +19,7 @@ License: perl

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

0 comments on commit b45269d

Please sign in to comment.