gbranden pushed a commit to branch master
in repository groff.
commit 44b9700a0e892059ac4d6c6284468e845801cecf
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Aug 21 08:06:13 2024 -0500
src/utils/afmtodit/afmtodit.pl: Refactor (2/4).
* src/utils/afmtodit/afmtodit.pl: Add new `opt_w` scalar to separate it
from existing `space_width` scalar so that we can report the options
we were invoked with in a comment in the generated file.
---
ChangeLog | 5 ++++-
src/utils/afmtodit/afmtodit.pl | 7 +++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5613845af..5dab3a9d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,10 @@
* src/utils/afmtodit/afmtodit.pl: Define `prog` scalar as only
the "basename" of argv[0], making diagnostic and usage messages
- less garrulous; see Savannah #65110.
+ less garrulous; see Savannah #65110. Add new `opt_w` scalar to
+ separate it from existing `space_width` scalar so that we can
+ report the options we were invoked with in a comment in the
+ generated file.
2024-08-21 G. Branden Robinson <[email protected]>
diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
index 4088a7933..8d8426db6 100644
--- a/src/utils/afmtodit/afmtodit.pl
+++ b/src/utils/afmtodit/afmtodit.pl
@@ -30,14 +30,17 @@ my $want_help;
my $space_width = 0;
our ($opt_a, $opt_c, $opt_d, $opt_e, $opt_f, $opt_i, $opt_k,
- $opt_m, $opt_n, $opt_o, $opt_s, $opt_v, $opt_x);
+ $opt_m, $opt_n, $opt_o, $opt_s, $opt_v, $opt_w, $opt_x);
use Getopt::Long qw(:config gnu_getopt);
GetOptions( "a=s", "c", "d=s", "e=s", "f=s", "i=s", "k", "m", "n",
- "o=s", "s", "v", "w=i" => \$space_width, "x", "version" => \$opt_v,
+ "o=s", "s", "v", "w=i", "x", "version" => \$opt_v,
"help" => \$want_help
);
+# We keep these two scalars separate so we can report out the option.
+$space_width = $opt_w if defined $opt_w;
+
my $afmtodit_version = "GNU afmtodit (groff) version @VERSION@";
if ($opt_v) {
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit