fspath.cli module¶
A command line interface made simple.
- class fspath.cli.CLI(*args, **kwargs)[source]¶
Bases:
object
A comfortable command line.
- ERR = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>¶
- OUT = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>¶
- autocomplete()[source]¶
bash completion
To get in use of bash completion, install
argcomplete
:pip install argcomplete
and add the following to your ~/.bashrc:
function _py_argcomplete() { local IFS=$(echo -e '\v') COMPREPLY=( $(IFS="$IFS" \ COMP_LINE="$COMP_LINE" \ COMP_POINT="$COMP_POINT" \ _ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" \ _ARGCOMPLETE=1 \ "$1" 8>&1 9>&2 1>/dev/null) ) if [[ $? != 0 ]]; then unset COMPREPLY fi } complete -o nospace -o default -F _py_argcomplete myCommandName
- exception fspath.cli.CLIApplError(exitCode, message)[source]¶
Bases:
Exception
Exception raised for errors in the application