Page MenuHomeFreeBSD

m4: Support long options.
ClosedPublic

Authored by des on Jun 21 2023, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 10:47 AM
Unknown Object (File)
Mon, Nov 4, 1:16 PM
Unknown Object (File)
Fri, Nov 1, 4:00 AM
Unknown Object (File)
Tue, Oct 29, 8:20 PM
Unknown Object (File)
Fri, Oct 18, 12:49 AM
Unknown Object (File)
Oct 7 2024, 1:15 PM
Unknown Object (File)
Oct 1 2024, 4:23 AM
Unknown Object (File)
Sep 30 2024, 3:49 PM
Subscribers

Details

Summary

The option names are identical to those of the equivalent options in GNU m4, except of course for --gnu which does not exist in GNU m4.

While here, make the argument to -d / --debug optional, with the same default behavior as in GNU m4, and document it properly.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Jun 21 2023, 3:58 PM
kevans added inline comments.
usr.bin/m4/main.c
64

We probably want a leading + in the short opt string to avoid the non-option permutation that rides along by default in getopt_long but not gwtopt.

Prevent permutation of non-option arguments.

des marked an inline comment as done.Jun 21 2023, 4:31 PM
This revision is now accepted and ready to land.Jun 21 2023, 4:32 PM
bcr added a subscriber: bcr.

OK for the manpages part. Thanks.

The mandoc markup looks weird to me, but like it could work... most likely my mdoc fu is too weak.
The code itself, however, looks spot on.

This revision was automatically updated to reflect the committed changes.