Changeset 3093:f1f998a31660 in roaraudio for roarclients/roar-config.c


Ignore:
Timestamp:
01/09/10 12:13:13 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added much better --help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roar-config.c

    r2875 r3093  
    5151}, * flags_ptr = NULL; 
    5252 
     53void usage (void) { 
     54 printf("Usage: roar-config [--version] [--libs] [--cflags] [lib]\n"); 
     55 
     56 printf("\nOptions:\n\n"); 
     57 
     58 printf( 
     59        "  --version          - Show version of library\n" 
     60        "  --libs             - Show linker flags (-lxxx) needed to link library\n" 
     61        "  --cflags           - Show compiler flags needed to link library\n" 
     62       ); 
     63 
     64} 
     65 
    5366int main (int argc, char * argv[]) { 
    5467 int i, h; 
     
    5871 
    5972 if ( argc == 1 ) { 
    60   printf("Usage: roar-config [--version] [--libs] [--cflags] [lib]\n"); 
     73  usage(); 
    6174  return 0; 
    6275 } 
     
    6578  if ( !strcmp(argv[i], "--version") ) { 
    6679   printf("unknown\n"); 
     80  } else if ( !strcmp(argv[i], "--help") || !strcmp(argv[i], "-h") ) { 
     81   usage(); 
     82   return 0; 
    6783  } else if ( !strcmp(argv[i], "--libs") ) { 
    6884   libs   = 1; 
     
    84100  } else { 
    85101   fprintf(stderr, "Unknown option: %s\n", argv[i]); 
     102   usage(); 
    86103   return 1; 
    87104  } 
Note: See TracChangeset for help on using the changeset viewer.