better error msg on unknown action

$ vips fred --n

would confusingly complain about unknown option --n, rather than the
unknown acrion "fred"
This commit is contained in:
John Cupitt 2013-03-15 12:15:35 +00:00
parent 386d73770e
commit 9cb1403b9b
3 changed files with 9 additions and 9 deletions

View File

@ -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

1
TODO
View File

@ -1,4 +1,3 @@
- look at
There is an order 1 algorithm for doing medians over boxes (truly O(1)

View File

@ -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();