From a13ec2aef8daf20f1ab301f363443a92687077c9 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 27 Jun 2014 14:33:40 +0100 Subject: [PATCH] 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 --- ChangeLog | 1 + libvips/iofuncs/operation.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 691a770e..f67f4fef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 25/6/14 started 7.40.2 - dzsave write to zip stops at 4gb, thanks bgilbert +- improve short option name handling, thanks bgilbert 24/6/14 started 7.40.1 - revise man.1 pages diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c index 716e1b38..738829a4 100644 --- a/libvips/iofuncs/operation.c +++ b/libvips/iofuncs/operation.c @@ -953,9 +953,15 @@ vips_call_options_add( VipsObject *object, GOptionEntry entry[2]; entry[0].long_name = name; - entry[0].short_name = name[0]; 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; if( !needs_string ) entry[0].flags |= G_OPTION_FLAG_NO_ARG;