Parser
clap.Parser
A base class for static type checking.
Classes decorated with @clap.command
will have a
parse_args
method injected at runtime.
Inheriting from Parser
provides this method signature to
static type checkers, avoiding errors and enabling autocompletion in
editors.
This class is not strictly required for functionality.
Example:
import clap
@clap.command
class Cli(clap.Parser):
...
args = Cli.parse_args()
Methods:
-
parse_args
–Parse from
sys.argv
, exit on error.