From 9afe09a68f72cdef3448a4dab2729cdbd75228b9 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 May 2011 11:35:29 +0100 Subject: [PATCH] better bool CLI options --- libvips/arithmetic/arithmetic.c | 3 ++- libvips/iofuncs/operation.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libvips/arithmetic/arithmetic.c b/libvips/arithmetic/arithmetic.c index 22fe3538..a086ab4e 100644 --- a/libvips/arithmetic/arithmetic.c +++ b/libvips/arithmetic/arithmetic.c @@ -218,7 +218,8 @@ vips_arithmetic_compile( VipsArithmeticClass *class ) printf( "vips_arithmetic_compile: " ); for( i = 0; i < IM_BANDFMT_LAST; i++ ) if( class->vector_program[i] ) - printf( "%s ", VIPS_ENUM_NICK( VIPS_TYPE_FORMAT, i ) ); + printf( "%s ", + VIPS_ENUM_NICK( VIPS_TYPE_BAND_FORMAT, i ) ); printf( "\n" ); #endif /*DEBUG*/ } diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c index 633de53e..da9e9c45 100644 --- a/libvips/iofuncs/operation.c +++ b/libvips/iofuncs/operation.c @@ -476,7 +476,8 @@ vips_call_options_add( VipsObject *object, entry[0].long_name = g_param_spec_get_name( pspec ); entry[0].short_name = g_param_spec_get_name( pspec )[0]; - entry[0].flags = G_OPTION_FLAG_OPTIONAL_ARG; + if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) + entry[0].flags = G_OPTION_FLAG_NO_ARG; entry[0].arg = G_OPTION_ARG_CALLBACK; entry[0].arg_data = (gpointer) vips_call_options_set; entry[0].description = g_param_spec_get_blurb( pspec );