1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-21 19:48:05 +01:00

* g10.c (list_config): Add "version" tag for --list-config.

This commit is contained in:
David Shaw 2004-01-21 04:21:29 +00:00
parent 9e6119f07b
commit 335d393062
2 changed files with 35 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2004-01-20 David Shaw <dshaw@jabberwocky.com>
* g10.c (list_config): Add "version" tag for --list-config.
2004-01-15 David Shaw <dshaw@jabberwocky.com>
* g10.c (collapse_args): New function to turn argc/argv into a

View File

@ -1091,13 +1091,43 @@ static void
list_config(char *items)
{
int show_all=(items==NULL);
char *name;
char *name=NULL;
if(!opt.with_colons)
return;
while(show_all || (name=strsep(&items," ")))
{
if(show_all || ascii_strcasecmp(name,"group")==0)
{
struct groupitem *iter;
for(iter=opt.grouplist;iter;iter=iter->next)
{
STRLIST sl;
printf("cfg:group:");
print_string(stdout,iter->name,strlen(iter->name),':');
printf(":");
for(sl=iter->values;sl;sl=sl->next)
{
print_string2(stdout,sl->d,strlen(sl->d),':',';');
if(sl->next)
printf(";");
}
printf("\n");
}
}
if(show_all || ascii_strcasecmp(name,"version")==0)
{
printf("cfg:version:");
print_string(stdout,VERSION,strlen(VERSION),':');
printf("\n");
}
if(show_all || ascii_strcasecmp(name,"pubkey")==0)
{
printf("cfg:pubkey:");
@ -1128,29 +1158,6 @@ list_config(char *items)
printf("\n");
}
if(show_all || ascii_strcasecmp(name,"group")==0)
{
struct groupitem *iter;
for(iter=opt.grouplist;iter;iter=iter->next)
{
STRLIST sl;
printf("cfg:group:");
print_string(stdout,iter->name,strlen(iter->name),':');
printf(":");
for(sl=iter->values;sl;sl=sl->next)
{
print_string2(stdout,sl->d,strlen(sl->d),':',';');
if(sl->next)
printf(";");
}
printf("\n");
}
}
if(show_all)
break;
}