Parser
clap.Parser
A base class for static type checking.
Classes decorated with @clap.command will have a
parse 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()
Methods:
parse
abstractmethod
classmethod
Parse from the provided args or sys.argv, exit on error.
Source code in clap/api.py
56 57 58 59 | |