Page MenuHomeFreeBSD

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

Authored by bcran on Thu, Feb 13, 4:03 PM.

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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 29357
Build 27256: arc lint + arc unit

Event Timeline

bcran created this revision.Thu, Feb 13, 4:03 PM
bcran added a comment.Thu, Feb 13, 4:22 PM

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.

bcran updated this revision to Diff 68264.Thu, Feb 13, 6:40 PM

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.Thu, Feb 13, 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).

bcran added a comment.Sat, Feb 15, 7:04 PM

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