Base class for subcommands under
T = TypeVar("T", bound="Subcommand")
An abstract class representing subcommands for allennlp.run.
If you wanted to (for example) create your own custom
special-evaluate command to use like
allennlp special-evaluate ...
you would create a
Subcommand subclass and then pass it as an override to
class Subcommand(Registrable): | ... | requires_plugins: bool = True
True, the sub-command will trigger a call to
import_plugins() (except for custom
subcommands which come from plugins, since plugins will already have been imported by the
time the subcommand is discovered), and will also have an additional
class Subcommand(Registrable): | ... | def add_subparser( | self, | parser: argparse._SubParsersAction | ) -> argparse.ArgumentParser
class Subcommand(Registrable): | ... | @classmethod | def register( | cls: Type[T], | name: str, | constructor: Optional[str] = None, | exist_ok: bool = False | ) -> Callable[[Type[T]], Type[T]]
class Subcommand(Registrable): | ... | @property | def name(self) -> str