improve short option name handling

we were setting short option names for deprecated options causing
confusion, see:

https://github.com/jcupitt/libvips/issues/110

thanks bgilbert
This commit is contained in:
John Cupitt 2014-06-27 14:33:40 +01:00
parent 243c86f405
commit a13ec2aef8
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
25/6/14 started 7.40.2 25/6/14 started 7.40.2
- dzsave write to zip stops at 4gb, thanks bgilbert - dzsave write to zip stops at 4gb, thanks bgilbert
- improve short option name handling, thanks bgilbert
24/6/14 started 7.40.1 24/6/14 started 7.40.1
- revise man.1 pages - revise man.1 pages

View File

@ -953,9 +953,15 @@ vips_call_options_add( VipsObject *object,
GOptionEntry entry[2]; GOptionEntry entry[2];
entry[0].long_name = name; entry[0].long_name = name;
entry[0].short_name = name[0];
entry[0].description = g_param_spec_get_blurb( pspec ); entry[0].description = g_param_spec_get_blurb( pspec );
/* Don't set short names for deprecated args.
*/
if( argument_class->flags & VIPS_ARGUMENT_DEPRECATED )
entry[0].short_name = '\0';
else
entry[0].short_name = name[0];
entry[0].flags = 0; entry[0].flags = 0;
if( !needs_string ) if( !needs_string )
entry[0].flags |= G_OPTION_FLAG_NO_ARG; entry[0].flags |= G_OPTION_FLAG_NO_ARG;