MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / __call__

Method __call__

commitizen/cli.py:48–65  ·  view source on GitHub ↗
(
        self,
        parser: argparse.ArgumentParser,
        namespace: argparse.Namespace,
        values: object,
        option_string: str | None = None,
    )

Source from the content-addressed store, hash-verified

46 """
47
48 def __call__(
49 self,
50 parser: argparse.ArgumentParser,
51 namespace: argparse.Namespace,
52 values: object,
53 option_string: str | None = None,
54 ) -> None:
55 if not isinstance(values, str):
56 return
57
58 key, sep, value = values.partition("=")
59 if not key or not sep:
60 raise InvalidCommandArgumentError(
61 f"Option {option_string} expect a key=value format"
62 )
63 kwargs = getattr(namespace, self.dest, None) or {}
64 kwargs[key] = value.strip("'\"")
65 setattr(namespace, self.dest, kwargs)
66
67
68tpl_arguments = (

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected