CPython itself has certain command-line options that cause all further arguments to be interpreted as non-options ("terminates option list"). For example, -c cmd
is such an option, so python3 -c 'import sys; print(sys.argv)' -E
prints [-c, -E]
; -E
isn't recognized as an option.
Is there a way to define an option of this kind for an argparse
parser?