Skip to content

Commit 73b5193

Browse files
committed
The printf here do not mention the executable name now.
We don't need the name of dwarfdump anyway, and this keeps the baselines simple, not having to realize dwarfdump.O is the same ( in the sense of comparing baseline text) as dwarfdump. See libdwarf-regressiontests for the tests involved. modified: src/bin/dwarfdump/dd_getopt.c
1 parent b22dc67 commit 73b5193

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/bin/dwarfdump/dd_getopt.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,8 @@ int dwgetopt_long(int nargc, char *const nargv[],
205205

206206
if (!dwlopt->name) {
207207
dwoptind++;
208-
(void)printf("ERROR "
209-
"%s: invalid long option '--%s'\n",
210-
nargv[0]?nargv[0]:"",
211-
place);
208+
(void)printf("ERROR:"
209+
" invalid long option '--%s'\n", place);
212210
/* Leave longindex unchanged. */
213211
dd_minimal_count_global_error();
214212
place = EMSG;
@@ -244,17 +242,14 @@ int dwgetopt_long(int nargc, char *const nargv[],
244242
match GNU getopt_long behavior
245243
of taking next argv as the arg value.
246244
and thus making getopt_long succeed. */
247-
(void)printf("ERROR "
248-
"%s: missing required long option "
249-
"argument '--%s'\n",
250-
nargv[0]?nargv[0]:"",
251-
place);
245+
(void)printf("ERROR:"
246+
" missing required long option "
247+
"argument '--%s'\n", place);
252248
dd_minimal_count_global_error();
253249
} else {
254250
/* has arg but should not */
255-
(void)printf("ERROR "
256-
"%s: option '--%s' does not allow an argument\n",
257-
nargv[0]?nargv[0]:"",
251+
(void)printf("ERROR:"
252+
" option '--%s' does not allow an argument\n",
258253
dwlopt->name);
259254
dd_minimal_count_global_error();
260255
}
@@ -328,10 +323,8 @@ dwgetopt(int nargc, char * const nargv[], const char *ostr)
328323
++dwoptind;
329324
}
330325
if (dwopterr && *ostr != ':') {
331-
(void)printf("ERROR "
332-
"%s: invalid option -- '%c'\n",
333-
nargv[0]?nargv[0]:"",
334-
dwoptopt);
326+
(void)printf("ERROR:"
327+
" invalid option -- '%c'\n", dwoptopt);
335328
dd_minimal_count_global_error();
336329
}
337330
return (BADCH);
@@ -367,9 +360,8 @@ dwgetopt(int nargc, char * const nargv[], const char *ostr)
367360
return (BADARG);
368361
}
369362
if (dwopterr) {
370-
(void)printf("ERROR "
371-
"%s: option requires an argument. -- '%c'\n",
372-
nargv[0]?nargv[0]:"",
363+
(void)printf("ERROR:"
364+
" option requires an argument. -- '%c'\n",
373365
dwoptopt);
374366
dd_minimal_count_global_error();
375367
}

0 commit comments

Comments
 (0)