Internal function to parse CLI arguments of a function.
(
func: DecoratorCallable,
args: List[str]
)
| 3639 | |
| 3640 | @staticmethod |
| 3641 | def _parsekwargs( |
| 3642 | func: DecoratorCallable, |
| 3643 | args: List[str] |
| 3644 | ) -> Tuple[List[str], Dict[str, Literal[True]]]: |
| 3645 | """ |
| 3646 | Internal function to parse CLI arguments of a function. |
| 3647 | """ |
| 3648 | kwargs: Dict[str, Literal[True]] = {} |
| 3649 | if func._flags: # type: ignore |
| 3650 | i = 0 |
| 3651 | for arg in args: |
| 3652 | if arg in func._flags: # type: ignore |
| 3653 | i += 1 |
| 3654 | kwargs[func._flagnames[func._flags.index(arg)]] = True # type: ignore # noqa: E501 |
| 3655 | continue |
| 3656 | break |
| 3657 | args = args[i:] |
| 3658 | return args, kwargs |
| 3659 | |
| 3660 | @classmethod |
| 3661 | def _parseallargs( |