Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
8be58f39
...
8be58f39a54921e61a9665d3f5ff82ebc09b8b13
authored
2002-04-11 10:12:24 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixed auto-arranging of options groups. Fixed spelling of license option.
1 parent
1c6da6b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
lib/mu_argp.c
lib/mu_argp.c
View file @
8be58f3
...
...
@@ -64,8 +64,8 @@ static struct argp_option mu_common_argp_options[] =
{
NULL
,
0
,
NULL
,
0
,
NULL
,
0
}
};
/* Option to print the licen
c
e. */
static
struct
argp_option
mu_licen
c
e_argp_option
[]
=
{
/* Option to print the licen
s
e. */
static
struct
argp_option
mu_licen
s
e_argp_option
[]
=
{
{
"license"
,
'L'
,
NULL
,
0
,
"Print license and exit"
,
-
2
},
{
NULL
,
0
,
NULL
,
0
,
NULL
,
0
}
};
...
...
@@ -139,20 +139,20 @@ struct argp mu_common_argp = {
struct
argp_child
mu_common_argp_child
=
{
&
mu_common_argp
,
0
,
""
,
-
1
0
,
NULL
,
0
,
};
struct
argp
mu_licen
c
e_argp
=
{
mu_licen
c
e_argp_option
,
struct
argp
mu_licen
s
e_argp
=
{
mu_licen
s
e_argp_option
,
mu_common_argp_parser
,
};
struct
argp_child
mu_licen
c
e_argp_child
=
{
&
mu_licen
c
e_argp
,
struct
argp_child
mu_licen
s
e_argp_child
=
{
&
mu_licen
s
e_argp
,
0
,
""
,
-
2
NULL
,
0
};
struct
argp
mu_mailbox_argp
=
{
...
...
@@ -163,8 +163,8 @@ struct argp mu_mailbox_argp = {
struct
argp_child
mu_mailbox_argp_child
=
{
&
mu_mailbox_argp
,
0
,
""
,
-
3
NULL
,
0
};
struct
argp
mu_logging_argp
=
{
...
...
@@ -175,8 +175,8 @@ struct argp mu_logging_argp = {
struct
argp_child
mu_logging_argp_child
=
{
&
mu_logging_argp
,
0
,
""
,
-
3
NULL
,
0
};
struct
argp
mu_auth_argp
=
{
...
...
@@ -188,6 +188,7 @@ struct argp_child mu_auth_argp_child = {
&
mu_auth_argp
,
0
,
"Authentication options"
,
0
};
struct
argp
mu_daemon_argp
=
{
...
...
@@ -276,7 +277,7 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
{
/* common */
case
'L'
:
printf
(
"Licen
c
e for %s:
\n\n
"
,
argp_program_version
);
printf
(
"Licen
s
e for %s:
\n\n
"
,
argp_program_version
);
printf
(
"%s"
,
license_text
);
exit
(
0
);
...
...
@@ -664,7 +665,7 @@ struct argp_capa {
struct
argp_child
*
child
;
}
mu_argp_capa
[]
=
{
{
"common"
,
&
mu_common_argp_child
},
{
"licen
ce"
,
&
mu_licenc
e_argp_child
},
{
"licen
se"
,
&
mu_licens
e_argp_child
},
{
"mailbox"
,
&
mu_mailbox_argp_child
},
{
"logging"
,
&
mu_logging_argp_child
},
{
"auth"
,
&
mu_auth_argp_child
},
...
...
@@ -688,8 +689,9 @@ mu_build_argp (const struct argp *template, const char *capa[])
int
n
;
int
nchild
;
struct
argp_child
*
ap
;
struct
argp_option
*
opt
;
struct
argp
*
argp
;
int
group
=
-
10
0
;
int
group
=
0
;
/* Count the capabilities. */
for
(
n
=
0
;
capa
&&
capa
[
n
];
n
++
)
...
...
@@ -711,7 +713,13 @@ mu_build_argp (const struct argp *template, const char *capa[])
for
(
n
=
0
;
template
->
children
[
n
].
argp
;
n
++
,
nchild
++
)
ap
[
nchild
]
=
template
->
children
[
n
];
group
=
-
nchild
-
1
;
/* Find next group number */
for
(
opt
=
template
->
options
;
opt
&&
((
opt
->
name
&&
opt
->
key
)
||
opt
->
doc
);
opt
++
)
if
(
opt
->
group
>
group
)
group
=
opt
->
group
;
group
++
;
/* Append any capabilities to the children or options, as appropriate. */
for
(
n
=
0
;
capa
&&
capa
[
n
];
n
++
)
...
...
@@ -724,7 +732,7 @@ mu_build_argp (const struct argp *template, const char *capa[])
abort
();
}
ap
[
nchild
]
=
*
child
;
//
ap[nchild].group = group++;
ap
[
nchild
].
group
=
group
++
;
nchild
++
;
}
ap
[
nchild
].
argp
=
NULL
;
...
...
Please
register
or
sign in
to post a comment