deps/kb_meme/meme-5.0.1/src/meme2alph.c
/**************************************************************************
 * Process the command line arguments and put the results in the
 * options structure.
 **************************************************************************/
Process the command line arguments and put the results in the
options structure.
Process the command line arguments and put the results in the options structure .
void process_arguments(int argc, char **argv, OPTIONS_T *options) {
  bool bad_argument = false;
  struct option meme2alph_options[] = {
    {"help", no_argument, NULL, 'h'},
    {NULL, 0, NULL, 0} 
  };
  options->motifs_file = NULL;
  options->alphabet_file = "-";
  while (1) {
    int opt = getopt_long_only(argc, argv, "", meme2alph_options, NULL);
    if (opt == -1) break;
    switch (opt) {
      case 'h':           
        usage(NULL);
        break;
      case '?':           
        bad_argument = true;
    }
  }
  if (bad_argument) usage("One or more unknown or ambiguous options were supplied.");
  if (optind >= argc) usage("No motif file!");
  options->motifs_file = argv[optind++];
  if (!file_exists(options->motifs_file)) 
    usage("Motif file \"%s\" does not exist!", options->motifs_file);
  if (optind < argc) {
    options->alphabet_file = argv[optind++];
  }
}
void process_arguments ( int argc , char * * argv , OPTIONS_T * options ) { bool bad_argument = false ; struct option meme2alph_options [ ] = { { " " , no_argument , NULL , ' ' } , { NULL , 0 , NULL , 0 } } ; options -> motifs_file = NULL ; options -> alphabet_file = " " ; while ( 1 ) { int opt = getopt_long_only ( argc , argv , " " , meme2alph_options , NULL ) ; if ( opt == -1 ) break ; switch ( opt ) { case ' ' : usage ( NULL ) ; break ; case ' ' : bad_argument = true ; } } if ( bad_argument ) usage ( " " ) ; if ( optind >= argc ) usage ( " " ) ; options -> motifs_file = argv [ optind ++ ] ; if ( ! file_exists ( options -> motifs_file ) ) usage ( " \" \" " , options -> motifs_file ) ; if ( optind < argc ) { options -> alphabet_file = argv [ optind ++ ] ; } }
Process the command line arguments and put the results in the
 options structure.
Process the command line arguments and put the results in the options structure .
//boundary indicator // set defaults // parse optional arguments //-help //unrecognised or ambiguous argument // get the motif file // get the output directory