mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-30 16:17:02 +01:00
2004-02-26 Marcus Brinkmann <marcus@g10code.de>
* gpgconf-comp.c (gc_component_list_options): Do not print empty groups.
This commit is contained in:
parent
91a514f2a1
commit
4a038d65af
@ -1,5 +1,8 @@
|
|||||||
2004-02-26 Marcus Brinkmann <marcus@g10code.de>
|
2004-02-26 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* gpgconf-comp.c (gc_component_list_options): Do not print empty
|
||||||
|
groups.
|
||||||
|
|
||||||
* gpgconf-comp.c (option_check_validity): Check if option is
|
* gpgconf-comp.c (option_check_validity): Check if option is
|
||||||
active.
|
active.
|
||||||
(change_options_file): Implement.
|
(change_options_file): Implement.
|
||||||
|
@ -736,25 +736,13 @@ gc_component_find (const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* List all options of the component COMPONENT. */
|
/* List the option OPTION. */
|
||||||
void
|
static void
|
||||||
gc_component_list_options (int component, FILE *out)
|
list_one_option (const gc_option_t *option, FILE *out)
|
||||||
{
|
{
|
||||||
const gc_option_t *option = gc_component[component].options;
|
|
||||||
|
|
||||||
while (option->name)
|
|
||||||
{
|
|
||||||
const char *desc = NULL;
|
const char *desc = NULL;
|
||||||
char *arg_name = NULL;
|
char *arg_name = NULL;
|
||||||
|
|
||||||
/* Do not output unknown or internal options. */
|
|
||||||
if (!(option->flags & GC_OPT_FLAG_GROUP)
|
|
||||||
&& (!option->active || option->level == GC_LEVEL_INTERNAL))
|
|
||||||
{
|
|
||||||
option++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (option->desc)
|
if (option->desc)
|
||||||
{
|
{
|
||||||
desc = my_dgettext (option->desc_domain, option->desc);
|
desc = my_dgettext (option->desc_domain, option->desc);
|
||||||
@ -774,9 +762,10 @@ gc_component_list_options (int component, FILE *out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* YOU MUST NOT REORDER THE FIELDS IN THIS OUTPUT, AS THEIR
|
|
||||||
ORDER IS PART OF THE EXTERNAL INTERFACE. YOU MUST NOT REMOVE
|
/* YOU MUST NOT REORDER THE FIELDS IN THIS OUTPUT, AS THEIR ORDER IS
|
||||||
ANY FIELDS. */
|
PART OF THE EXTERNAL INTERFACE. YOU MUST NOT REMOVE ANY
|
||||||
|
FIELDS. */
|
||||||
|
|
||||||
/* The name field. */
|
/* The name field. */
|
||||||
fprintf (out, "%s", option->name);
|
fprintf (out, "%s", option->name);
|
||||||
@ -854,6 +843,39 @@ gc_component_list_options (int component, FILE *out)
|
|||||||
/* ADD NEW FIELDS HERE. */
|
/* ADD NEW FIELDS HERE. */
|
||||||
|
|
||||||
putc ('\n', out);
|
putc ('\n', out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* List all options of the component COMPONENT. */
|
||||||
|
void
|
||||||
|
gc_component_list_options (int component, FILE *out)
|
||||||
|
{
|
||||||
|
const gc_option_t *option = gc_component[component].options;
|
||||||
|
const gc_option_t *group_option = NULL;
|
||||||
|
|
||||||
|
while (option->name)
|
||||||
|
{
|
||||||
|
/* Do not output unknown or internal options. */
|
||||||
|
if (!(option->flags & GC_OPT_FLAG_GROUP)
|
||||||
|
&& (!option->active || option->level == GC_LEVEL_INTERNAL))
|
||||||
|
{
|
||||||
|
option++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option->flags & GC_OPT_FLAG_GROUP)
|
||||||
|
group_option = option;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (group_option)
|
||||||
|
{
|
||||||
|
list_one_option (group_option, out);
|
||||||
|
group_option = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
list_one_option (option, out);
|
||||||
|
}
|
||||||
|
|
||||||
option++;
|
option++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user