FreeBSD Bugzilla – Attachment 221537 Details for
Bug 252644
ifconfig 'usage' does not match man page synopsis
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Possible patch
ifconfig.c.diff (text/plain), 1.74 KB, created by
ghuckriede
on 2021-01-13 18:18:54 UTC
(
hide
)
Description:
Possible patch
Filename:
MIME Type:
Creator:
ghuckriede
Created:
2021-01-13 18:18:54 UTC
Size:
1.74 KB
patch
obsolete
>Index: sbin/ifconfig/ifconfig.c >=================================================================== >--- sbin/ifconfig/ifconfig.c (revision 369005) >+++ sbin/ifconfig/ifconfig.c (working copy) >@@ -177,24 +177,36 @@ > static void > usage(void) > { >- char options[1024]; > struct option *p; >+ char optC[8] = {0}; >+ char optL[8] = {0}; >+ char optg[32] = {0}; > >- /* XXX not right but close enough for now */ >- options[0] = '\0'; >+ /* Create strings for "opts" options */ > for (p = opts; p != NULL; p = p->next) { >- strlcat(options, p->opt_usage, sizeof(options)); >- strlcat(options, " ", sizeof(options)); >+ if (p->opt[0] == 'g') { >+ strlcat(optg, " ", sizeof(optg)); >+ strlcat(optg, p->opt_usage, sizeof(optg)); >+ } else if (p->opt[0] == 'L') { >+ strlcat(optL, " ", sizeof(optL)); >+ strlcat(optL, p->opt_usage, sizeof(optL)); >+ } else if (p->opt[0] == 'C') { >+ strlcat(optC, " ", sizeof(optC)); >+ strlcat(optC, p->opt_usage, sizeof(optC)); >+ } > } > > fprintf(stderr, >- "usage: ifconfig [-f type:format] %sinterface address_family\n" >- " [address [dest_address]] [parameters]\n" >- " ifconfig interface create\n" >- " ifconfig -a %s[-d] [-m] [-u] [-v] [address_family]\n" >+ "usage: ifconfig [-f type:format[,type:format]]%s [-k] [-m] [-n] interface\n" >+ " [create] address_family [address [dest_address]] [parameters]\n" >+ " ifconfig interface destroy\n" >+ " ifconfig -a%s [-d]%s [-m] [-u] [-v] [address_family]\n" > " ifconfig -l [-d] [-u] [address_family]\n" >- " ifconfig %s[-d] [-m] [-u] [-v]\n", >- options, options, options); >+ " ifconfig%s [-d] [-k] [-m] [-u] [-v]%s\n", >+ optL, optL, optg, optL, optC); >+ if (optg[0] != 0) { >+ fprintf(stderr, " ifconfig%s\n", optg); >+ } > exit(1); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 252644
: 221537