Page MenuHomeFreeBSD

dtc: remove unknown option printf, since getopt will print it
ClosedPublic

Authored by bcran on Feb 13 2020, 4:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 5 2024, 9:18 PM
Unknown Object (File)
Dec 20 2023, 7:42 AM
Unknown Object (File)
Dec 17 2023, 6:38 AM
Unknown Object (File)
Dec 12 2023, 4:26 AM
Unknown Object (File)
Nov 1 2023, 3:25 AM
Unknown Object (File)
Sep 23 2023, 6:54 PM
Unknown Object (File)
Sep 6 2023, 4:41 AM
Unknown Object (File)
Jun 26 2023, 8:11 PM
Subscribers

Details

Summary

Since we don't set opterr to 0, getopt prints a message when it
encounters an unknown/invalid option. We therefore don't need to
print our own message in the default handler.

Test Plan

Before:
% dtc -z
dtc: illegal option -- z
Unknown option ?

After:
% dtc -z
dtc: illegal option -- z

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29347
Build 27246: arc lint + arc unit

Event Timeline

change should also go here: https://github.com/davidchisnall/dtc

Oh I was wondering if there was an upstream!

Oh I was wondering if there was an upstream!

It's a pseudo-upstream - we don't bring it in via vendor/, but @theraven uses the git repo to coordinate development.

I'd be tempted to drop this one since the other message is more informative -- adding David.

Remove the print statement in the default handler.

bcran retitled this revision from dtc: unknown getopt option character is in optopt, not ch to dtc: remove unknown option printf, since getopt will print it.Feb 13 2020, 6:41 PM
bcran edited the summary of this revision. (Show Details)
bcran edited the test plan for this revision. (Show Details)

This looks fine, but please submit it as a GitHub PR so that it goes through CI (I can't imagine it failing).

This looks fine, but please submit it as a GitHub PR so that it goes through CI (I can't imagine it failing).

Done! https://github.com/davidchisnall/dtc/pull/63

This has been accepted to the GitHub repo; please commit at-will.

This revision is now accepted and ready to land.Feb 18 2020, 7:28 PM