base.py 404 B

1234567891011121314151617181920
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. from abc import ABC, abstractmethod
  3. from argparse import ArgumentParser
  4. class CLICommand(ABC):
  5. """
  6. Base class for command line tool.
  7. """
  8. @staticmethod
  9. @abstractmethod
  10. def define_args(parsers: ArgumentParser):
  11. raise NotImplementedError()
  12. @abstractmethod
  13. def execute(self):
  14. raise NotImplementedError()