command_parser
index
/users/schrei_f/src/py4CAtS/var/command_parser.py

####################################################################################################################################
##########     LICENSE issues:                                                                                            ##########
##########                       This file is part of the Py4CAtS package.                                                ##########
##########                       Copyright 2002 - 2021; Franz Schreier;  DLR-IMF Oberpfaffenhofen                         ##########
##########                       Py4CAtS is distributed under the terms of the GNU General Public License;                ##########
##########                       see the file ../license.txt in the parent directory.                                     ##########
####################################################################################################################################

 
Modules
       
getopt
keyword
numpy
os
re
sys

 
Functions
       
change_defaults(opts, userDefaults)
Replace standard options by user specified options.
check_constraint(value, name, constraint)
Perform various checks on name and value of a given option.
check_options(optionsGiven, knownOptions, verbose=0)
Check the options specified on the command line wrt type and constraits,
add unspecified options with defaults if available.
check_type(id, name, given, oType)
getopt_parser(ShortOptions, LongOptions)
Parse command line string using getopt.  Return list of files and a dictionary of options!
multiple_outFiles(inFiles, outFile)
Given a list of input file names and a 'template' (e.g. extension) for the output files,
return a list of output file names.
parse_command(knownOptions, numFiles=None, env4defaults='', verbose=0)
Parse command line arguments or interactively ask directly for files,  return options as a dictionary.
prepare4getopt(knownOptions)
Extract short and long option id's as an input for getopt.

 
Data
        standardOptions = [{'ID': 'h'}, {'ID': 'c', 'default': '#', 'type': <class 'str'>}, {'ID': 'o', 'type': <class 'str'>}]