src/orion/core/cli/base.py
def parse(self, argv):
        """Call argparse and generate a dictionary of arguments' value"""
        args = vars(self.parser.parse_args(argv))

        verbose = args.pop("verbose", 0)
        levels = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
        logging.basicConfig(
            format="%(asctime)-15s::%(levelname)s::%(name)s::%(message)s",
            level=levels.get(verbose, logging.DEBUG),
        )

        if args["command"] is None:
            self.parser.parse_args(["--help"])

        function = args.pop("func", None)
        empty_command = (argv[-1] if argv else sys.argv[-1]) == args["command"]
        if function is None or (empty_command and args.pop("help_empty", False)):
            self.parser.parse_args([args["command"], "--help"])

        return args, function
Call argparse and generate a dictionary of arguments' value
Call argparse and generate a dictionary of arguments' value
Call argparse and generate a dictionary of arguments ' value
def parse(self, argv):
        args = vars(self.parser.parse_args(argv))
        verbose = args.pop("verbose", 0)
        levels = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
        logging.basicConfig(
            format="%(asctime)-15s::%(levelname)s::%(name)s::%(message)s",
            level=levels.get(verbose, logging.DEBUG),
        )
        if args["command"] is None:
            self.parser.parse_args(["--help"])
        function = args.pop("func", None)
        empty_command = (argv[-1] if argv else sys.argv[-1]) == args["command"]
        if function is None or (empty_command and args.pop("help_empty", False)):
            self.parser.parse_args([args["command"], "--help"])
        return args, function
def parse ( self , argv ) : args = vars ( self . parser . parse_args ( argv ) ) verbose = args . pop ( "verbose" , 0 ) levels = { 0 : logging . WARNING , 1 : logging . INFO , 2 : logging . DEBUG } logging . basicConfig ( format = "%(asctime)-15s::%(levelname)s::%(name)s::%(message)s" , level = levels . get ( verbose , logging . DEBUG ) , ) if args [ "command" ] is None : self . parser . parse_args ( [ "--help" ] ) function = args . pop ( "func" , None ) empty_command = ( argv [ - 1 ] if argv else sys . argv [ - 1 ] ) == args [ "command" ] if function is None or ( empty_command and args . pop ( "help_empty" , False ) ) : self . parser . parse_args ( [ args [ "command" ] , "--help" ] ) return args , function
Call argparse and generate a dictionary of arguments' value
Call argparse and generate a dictionary of arguments ' value
"""Call argparse and generate a dictionary of arguments' value"""
self
argv