Page MenuHomeFreeBSD

m4: Support long options.
ClosedPublic

Authored by des on Jun 21 2023, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 2:45 AM
Unknown Object (File)
Apr 6 2024, 8:55 AM
Unknown Object (File)
Mar 9 2024, 8:28 PM
Unknown Object (File)
Dec 12 2023, 10:12 AM
Unknown Object (File)
Nov 26 2023, 5:58 AM
Unknown Object (File)
Nov 19 2023, 11:00 AM
Unknown Object (File)
Oct 21 2023, 2:24 PM
Unknown Object (File)
Oct 20 2023, 6:23 AM
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.