[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 07/14: [grog]: Handle "--" argument as documented.
From: |
G. Branden Robinson |
Subject: |
[groff] 07/14: [grog]: Handle "--" argument as documented. |
Date: |
Mon, 28 Jun 2021 00:44:50 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit bcbe248e394b545c1474480fd29d055e594689b0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Jun 27 15:12:46 2021 +1000
[grog]: Handle "--" argument as documented.
* src/utils/grog/grog.pl (handle_args): Rename scalar `double_minus` to
`no_more_options` so it actually communicates something. Drop
openability check of operand encountered after "--"; since it's on the
operand list, it will be checked later {in `handle_whole_files`}.
Stop pushing "--" itself onto the `filespec` list.
Fixes <https://savannah.gnu.org/bugs/index.php?60834>.
---
ChangeLog | 13 +++++++++++++
src/utils/grog/grog.pl | 14 ++++----------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 284c342..67245d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2021-06-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [grog]: Handle "--" argument as documented.
+
+ * src/utils/grog/grog.pl (handle_args): Rename scalar
+ `double_minus` to `no_more_options` so it actually communicates
+ something. Drop openability check of operand encountered after
+ "--"; since it's on the operand list, it will be checked later
+ {in `handle_whole_files`}. Stop pushing "--" itself onto the
+ `filespec` list.
+
+ Fixes <https://savannah.gnu.org/bugs/index.php?60834>.
+
+2021-06-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
[grog]: Revise operand handling, diagnostics, and exit status.
* src/utils/grog/grog.pl: Track more state so that we can
diff --git a/src/utils/grog/grog.pl b/src/utils/grog/grog.pl
index cfcfd51..89a5661 100644
--- a/src/utils/grog/grog.pl
+++ b/src/utils/grog/grog.pl
@@ -182,7 +182,7 @@ sub warn {
sub handle_args {
- my $double_minus = 0;
+ my $no_more_options = 0;
my $was_minus = 0;
my $was_T = 0;
my $optarg = 0;
@@ -196,13 +196,8 @@ sub handle_args {
next;
}
- if ( $double_minus ) {
- if (-f $arg && -r $arg) {
- push @filespec, $arg;
- } else {
- print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
- "grog: $arg is not a readable file.";
- }
+ if ($no_more_options) {
+ push @filespec, $arg;
next;
}
@@ -228,8 +223,7 @@ sub handle_args {
}
if ($arg eq '--') {
- $double_minus = 1;
- push(@filespec, $arg);
+ $no_more_options = 1;
next;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 07/14: [grog]: Handle "--" argument as documented.,
G. Branden Robinson <=