1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-03-21 21:39:58 +01:00

* g10.c (main): Give a deprecated option warning for --show-keyring,

--show-photos, --show-policy-url, --show-notation, and their respective
no- forms.

* options.skel: Remove show-photos and replace with list/verify-options
show-photos.  Remove no-mangle-dos-filenames.

* misc.c (parse_options): Allow for incomplete (but unambiguous) options.
This commit is contained in:
David Shaw 2003-10-10 03:05:05 +00:00
parent f633ef17dc
commit 40db05fb99
4 changed files with 73 additions and 13 deletions

View File

@ -1,3 +1,15 @@
2003-10-09 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Give a deprecated option warning for
--show-keyring, --show-photos, --show-policy-url, --show-notation,
and their respective no- forms.
* options.skel: Remove show-photos and replace with
list/verify-options show-photos. Remove no-mangle-dos-filenames.
* misc.c (parse_options): Allow for incomplete (but unambiguous)
options.
2003-10-09 Werner Koch <wk@gnupg.org> 2003-10-09 Werner Koch <wk@gnupg.org>
* ccid-driver.c (ccid_transceive): Add T=1 chaining for sending. * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.

View File

@ -1464,7 +1464,11 @@ main( int argc, char **argv )
sl=append_to_strlist( &nrings, pargs.r.ret_str); sl=append_to_strlist( &nrings, pargs.r.ret_str);
sl->flags=2; sl->flags=2;
break; break;
case oShowKeyring: opt.list_options|=LIST_SHOW_KEYRING; break; case oShowKeyring:
deprecated_warning(configname,configlineno,"--show-keyring",
"--list-options ","show-keyring");
opt.list_options|=LIST_SHOW_KEYRING;
break;
case oDebug: opt.debug |= pargs.r.ret_ulong; break; case oDebug: opt.debug |= pargs.r.ret_ulong; break;
case oDebugAll: opt.debug = ~0; break; case oDebugAll: opt.debug = ~0; break;
case oStatusFD: case oStatusFD:
@ -1637,10 +1641,18 @@ main( int argc, char **argv )
case oSigPolicyURL: add_policy_url(pargs.r.ret_str,0); break; case oSigPolicyURL: add_policy_url(pargs.r.ret_str,0); break;
case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break; case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break;
case oShowPolicyURL: case oShowPolicyURL:
deprecated_warning(configname,configlineno,"--show-policy-url",
"--list-options ","show-policy-url");
deprecated_warning(configname,configlineno,"--show-policy-url",
"--verify-options ","show-policy-url");
opt.list_options|=LIST_SHOW_POLICY; opt.list_options|=LIST_SHOW_POLICY;
opt.verify_options|=VERIFY_SHOW_POLICY; opt.verify_options|=VERIFY_SHOW_POLICY;
break; break;
case oNoShowPolicyURL: case oNoShowPolicyURL:
deprecated_warning(configname,configlineno,"--no-show-policy-url",
"--list-options ","no-show-policy-url");
deprecated_warning(configname,configlineno,"--no-show-policy-url",
"--verify-options ","no-show-policy-url");
opt.list_options&=~LIST_SHOW_POLICY; opt.list_options&=~LIST_SHOW_POLICY;
opt.verify_options&=~VERIFY_SHOW_POLICY; opt.verify_options&=~VERIFY_SHOW_POLICY;
break; break;
@ -1657,11 +1669,19 @@ main( int argc, char **argv )
break; break;
case oThrowKeyid: opt.throw_keyid = 1; break; case oThrowKeyid: opt.throw_keyid = 1; break;
case oNoThrowKeyid: opt.throw_keyid = 0; break; case oNoThrowKeyid: opt.throw_keyid = 0; break;
case oShowPhotos: case oShowPhotos:
deprecated_warning(configname,configlineno,"--show-photos",
"--list-options ","show-photos");
deprecated_warning(configname,configlineno,"--show-photos",
"--verify-options ","show-photos");
opt.list_options|=LIST_SHOW_PHOTOS; opt.list_options|=LIST_SHOW_PHOTOS;
opt.verify_options|=VERIFY_SHOW_PHOTOS; opt.verify_options|=VERIFY_SHOW_PHOTOS;
break; break;
case oNoShowPhotos: case oNoShowPhotos:
deprecated_warning(configname,configlineno,"--no-show-photos",
"--list-options ","no-show-photos");
deprecated_warning(configname,configlineno,"--no-show-photos",
"--verify-options ","no-show-photos");
opt.list_options&=~LIST_SHOW_PHOTOS; opt.list_options&=~LIST_SHOW_PHOTOS;
opt.verify_options&=~VERIFY_SHOW_PHOTOS; opt.verify_options&=~VERIFY_SHOW_PHOTOS;
break; break;
@ -1865,10 +1885,18 @@ main( int argc, char **argv )
case oSigNotation: add_notation_data( pargs.r.ret_str, 0 ); break; case oSigNotation: add_notation_data( pargs.r.ret_str, 0 ); break;
case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break; case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break;
case oShowNotation: case oShowNotation:
deprecated_warning(configname,configlineno,"--show-notation",
"--list-options ","show-notation");
deprecated_warning(configname,configlineno,"--show-notation",
"--verify-options ","show-notation");
opt.list_options|=LIST_SHOW_NOTATION; opt.list_options|=LIST_SHOW_NOTATION;
opt.verify_options|=VERIFY_SHOW_NOTATION; opt.verify_options|=VERIFY_SHOW_NOTATION;
break; break;
case oNoShowNotation: case oNoShowNotation:
deprecated_warning(configname,configlineno,"--no-show-notation",
"--list-options ","no-show-notation");
deprecated_warning(configname,configlineno,"--no-show-notation",
"--verify-options ","no-show-notation");
opt.list_options&=~LIST_SHOW_NOTATION; opt.list_options&=~LIST_SHOW_NOTATION;
opt.verify_options&=~VERIFY_SHOW_NOTATION; opt.verify_options&=~VERIFY_SHOW_NOTATION;
break; break;

View File

@ -672,6 +672,7 @@ parse_options(char *str,unsigned int *options,struct parse_options *opts)
while((tok=strsep(&str," ,"))) while((tok=strsep(&str," ,")))
{ {
int i,rev=0; int i,rev=0;
char *otok=tok;
if(tok[0]=='\0') if(tok[0]=='\0')
continue; continue;
@ -684,8 +685,25 @@ parse_options(char *str,unsigned int *options,struct parse_options *opts)
for(i=0;opts[i].name;i++) for(i=0;opts[i].name;i++)
{ {
if(ascii_strcasecmp(opts[i].name,tok)==0) size_t toklen=strlen(tok);
if(ascii_strncasecmp(opts[i].name,tok,toklen)==0)
{ {
/* We have a match, but it might be incomplete */
if(toklen!=strlen(opts[i].name))
{
int j;
for(j=i+1;opts[j].name;j++)
{
if(ascii_strncasecmp(opts[j].name,tok,toklen)==0)
{
log_info(_("ambiguous option `%s'\n"),otok);
return 0;
}
}
}
if(rev) if(rev)
*options&=~opts[i].bit; *options&=~opts[i].bit;
else else
@ -695,7 +713,10 @@ parse_options(char *str,unsigned int *options,struct parse_options *opts)
} }
if(!opts[i].name) if(!opts[i].name)
return 0; {
log_info(_("unknown option `%s'\n"),otok);
return 0;
}
} }
return 1; return 1;

View File

@ -74,14 +74,9 @@
#group mynames = paige 0x12345678 joe patti #group mynames = paige 0x12345678 joe patti
# Some old Windows platforms require 8.3 filenames. If your system
# can handle long filenames, uncomment this.
#no-mangle-dos-filenames
# Lock the file only once for the lifetime of a process. If you do # Lock the file only once for the lifetime of a process. If you do
# not define this, the lock will be obtained and released every time # not define this, the lock will be obtained and released every time
# it is needed - normally this is not needed. # it is needed, which is usually preferable.
#lock-once #lock-once
@ -155,10 +150,14 @@ keyserver hkp://subkeys.pgp.net
#keyserver-options auto-key-retrieve #keyserver-options auto-key-retrieve
# Uncomment this line to display photo user IDs in key listings and # Display photo user IDs in key listings
# when a signature from a key with a photo is verified.
#show-photos # list-options show-photos
# Display photo user IDs when a signature from a key with a photo is
# verified
# verify-options show-photos
# Use this program to display photo user IDs # Use this program to display photo user IDs
# #