vic/drivers/shared_all/src/cmd_proc.c
void
cmd_proc(int    argc,
         char **argv,
         char  *globalfilename)
{
    char GLOBAL_SET;
    int  optchar;

    if (argc == 1) {
        print_usage(argv[0]);
        exit(1);
    }

    GLOBAL_SET = false;

    while ((optchar = getopt(argc, argv, optstring)) != EOF) {
        switch ((char)optchar) {
        case 'v':
            /** Version information **/
            display_current_settings(DISP_VERSION);
            exit(EXIT_SUCCESS);
            break;
        case 'o':
            /** Compile-time options information **/
            display_current_settings(DISP_COMPILE_TIME);
            exit(EXIT_SUCCESS);
            break;
        case 'g':
            /** Global Parameters File **/
            strncpy(globalfilename, optarg, MAXSTRING);
            GLOBAL_SET = true;
            break;
        default:
            /** Print Usage if Invalid Command Line Arguments **/
            print_usage(argv[0]);
            exit(1);
            break;
        }
    }

    if (!GLOBAL_SET) {
        fprintf(stderr,
                "ERROR: Must set global control file using the '-g' flag\n");
        print_usage(argv[0]);
        exit(EXIT_FAILURE);
    }
}
/**********************************************************************
   cmd_proc                  Keith Cherkauer                1997

   This routine checks the command line for valid program options.  If
   no options are found, or an invalid combination of them appear, the
   routine calls usage() to print the model usage to the screen, before
   exiting execution.
**********************************************************************/
cmd_proc                  Keith Cherkauer                1997
This routine checks the command line for valid program options.  If
no options are found, or an invalid combination of them appear, the
routine calls usage() to print the model usage to the screen, before
exiting execution.
cmd_proc Keith Cherkauer 1997 This routine checks the command line for valid program options . If no options are found or an invalid combination of them appear the routine calls usage () to print the model usage to the screen before exiting execution .
void
cmd_proc(int    argc,
         char **argv,
         char  *globalfilename)
{
    char GLOBAL_SET;
    int  optchar;
    if (argc == 1) {
        print_usage(argv[0]);
        exit(1);
    }
    GLOBAL_SET = false;
    while ((optchar = getopt(argc, argv, optstring)) != EOF) {
        switch ((char)optchar) {
        case 'v':
            display_current_settings(DISP_VERSION);
            exit(EXIT_SUCCESS);
            break;
        case 'o':
            display_current_settings(DISP_COMPILE_TIME);
            exit(EXIT_SUCCESS);
            break;
        case 'g':
            strncpy(globalfilename, optarg, MAXSTRING);
            GLOBAL_SET = true;
            break;
        default:
            print_usage(argv[0]);
            exit(1);
            break;
        }
    }
    if (!GLOBAL_SET) {
        fprintf(stderr,
                "ERROR: Must set global control file using the '-g' flag\n");
        print_usage(argv[0]);
        exit(EXIT_FAILURE);
    }
}
void cmd_proc ( int argc , char * * argv , char * globalfilename ) { char GLOBAL_SET ; int optchar ; if ( argc == 1 ) { print_usage ( argv [ 0 ] ) ; exit ( 1 ) ; } GLOBAL_SET = false ; while ( ( optchar = getopt ( argc , argv , optstring ) ) != EOF ) { switch ( ( char ) optchar ) { case ' ' : display_current_settings ( DISP_VERSION ) ; exit ( EXIT_SUCCESS ) ; break ; case ' ' : display_current_settings ( DISP_COMPILE_TIME ) ; exit ( EXIT_SUCCESS ) ; break ; case ' ' : strncpy ( globalfilename , optarg , MAXSTRING ) ; GLOBAL_SET = true ; break ; default : print_usage ( argv [ 0 ] ) ; exit ( 1 ) ; break ; } } if ( ! GLOBAL_SET ) { fprintf ( stderr , " \n " ) ; print_usage ( argv [ 0 ] ) ; exit ( EXIT_FAILURE ) ; } }
cmd_proc                  Keith Cherkauer                1997
This routine checks the command line for valid program options.
cmd_proc Keith Cherkauer 1997 This routine checks the command line for valid program options .
/** Version information **/ /** Compile-time options information **/ /** Global Parameters File **/ /** Print Usage if Invalid Command Line Arguments **/