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)
Thu, Dec 5, 10:15 PM
Unknown Object (File)
Thu, Nov 28, 6:12 PM
Unknown Object (File)
Wed, Nov 27, 12:05 PM
Unknown Object (File)
Wed, Nov 27, 11:51 AM
Unknown Object (File)
Nov 17 2024, 7:39 AM
Unknown Object (File)
Nov 15 2024, 8:40 PM
Unknown Object (File)
Nov 11 2024, 12:05 PM
Unknown Object (File)
Nov 11 2024, 11:51 AM
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 29357
Build 27256: 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