From f477447d9af4097e8c5d4c15a3dd381237e93ee2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 13 Feb 1998 20:58:50 +0000 Subject: added option export --- util/argparse.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'util/argparse.c') diff --git a/util/argparse.c b/util/argparse.c index 0c8ad8f0b..620211e31 100644 --- a/util/argparse.c +++ b/util/argparse.c @@ -538,16 +538,31 @@ show_help( ARGPARSE_OPTS *opts, unsigned flags ) /* get max. length of long options */ for(i=indent=0; opts[i].short_opt; i++ ) { if( opts[i].long_opt ) - if( (j=strlen(opts[i].long_opt)) > indent && j < 35 ) - indent = j; + if( !opts[i].description || *opts[i].description != '\v' ) + if( (j=strlen(opts[i].long_opt)) > indent && j < 35 ) + indent = j; } /* example: " -v, --verbose Viele Sachen ausgeben" */ indent += 10; - puts("Options:"); + if( *opts[0].description != '\v' ) + puts("Options:"); for(i=0; opts[i].short_opt; i++ ) { s = _( opts[i].description ); if( s && *s== '\r' ) /* hide this line */ continue; + if( s && *s == '\v' ) { /* unindented comment only line */ + for(s++; *s; s++ ) { + if( *s == '\n' ) { + if( s[1] ) + putchar('\n'); + } + else + putchar(*s); + } + putchar('\n'); + continue; + } + if( opts[i].short_opt < 256 ) printf(" -%c", opts[i].short_opt ); else -- cgit v1.2.3