Keep only specific options from the command line argument list
This function allows us to peek at specific command line options when
using the optparse module. This is useful when some options affect what
other options should be available.
- Parameters:
novalopts - A sequence of options to keep that don't take an argument.
valopts - A sequence of options to keep that take a single argument.
args - The command line arguments to parse (as per sys.argv[:1]
- Returns:
- A list of strings containing the filtered version of args.
Will raise ValueError if there was a problem parsing the
command line.
|