From 9cb1403b9b7f75b3b83042afed4f15c262d3ae76 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 15 Mar 2013 12:15:35 +0000 Subject: [PATCH] better error msg on unknown action $ vips fred --n would confusingly complain about unknown option --n, rather than the unknown acrion "fred" --- ChangeLog | 1 + TODO | 1 - tools/vips.c | 16 ++++++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14aeefa9..5c84cef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 12/3/13 started 7.32.2 - removed some left-over debugging code from configure.ac +- better error messages from vips.c 6/2/13 started 7.32.1 - fix --without-lcms, thanks speckins diff --git a/TODO b/TODO index 9ece20c6..edcd7e49 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ - - look at There is an order 1 algorithm for doing medians over boxes (truly O(1) diff --git a/tools/vips.c b/tools/vips.c index 636775b4..c63118bb 100644 --- a/tools/vips.c +++ b/tools/vips.c @@ -957,11 +957,11 @@ action_list( VipsBuf *buf ) int i; vips_buf_appends( buf, _( "possible actions:\n" ) ); + vips_buf_appendf( buf, "%7s - %s\n", + "OPER", _( "execute vips operation OPER" ) ); for( i = 0; i < VIPS_NUMBER( actions ); i++ ) vips_buf_appendf( buf, "%7s - %s\n", actions[i].name, _( actions[i].description ) ); - vips_buf_appendf( buf, "%7s - %s\n", - "OP", _( "execute vips operation OP" ) ); } static void @@ -1200,18 +1200,18 @@ main( int argc, char **argv ) !handled ) im_error_clear(); - /* Still not handled? We may not have called parse_options(), so - * --help args may not have been processed. - */ - if( !handled ) - parse_options( context, &argc, argv ); - if( action && !handled ) { print_help( argc, argv ); error_exit( _( "unknown action \"%s\"" ), action ); } + /* Still not handled? We may not have called parse_options(), so + * --help args may not have been processed. + */ + if( !handled ) + parse_options( context, &argc, argv ); + g_option_context_free( context ); vips_shutdown();