Improved help text
This commit is contained in:
parent
d3833fb4a0
commit
be33c08738
1 changed files with 8 additions and 12 deletions
20
connect4.c
20
connect4.c
|
|
@ -88,18 +88,14 @@ int main( int argc, char *argv[] ){
|
|||
break;
|
||||
case 'h': // --help
|
||||
printf( "Usage: %s [OPTIONS]\n\n", argv[0] );
|
||||
for( int i = 0; long_options[i].name != NULL; i++ ){
|
||||
if( long_options[i].val != '\0' )
|
||||
printf( " -%c ", long_options[i].val );
|
||||
else printf( " " );
|
||||
if( long_options[i].has_arg )
|
||||
printf( "n" );
|
||||
else printf( " " );
|
||||
printf( " --%s ", long_options[i].name );
|
||||
if( long_options[i].has_arg )
|
||||
printf( "n\n" );
|
||||
else printf( "\n" );
|
||||
}
|
||||
printf(
|
||||
" -h --help Print this help text\n"
|
||||
" -l --license Print the LICENSE file\n"
|
||||
" --version Print the version string\n"
|
||||
"\n"
|
||||
" -c n --columns n Set the amount of columns\n"
|
||||
" -r n --rows n Set the amount of rows\n"
|
||||
);
|
||||
return 0;
|
||||
case 'l': // --license
|
||||
for(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue