Parse ARGS against the real CLI without running the command.
(args: list[str])
| 2621 | |
| 2622 | |
| 2623 | def _parse_cli_args(args: list[str]) -> None: |
| 2624 | """Parse ARGS against the real CLI without running the command.""" |
| 2625 | command: click.Command = crewai |
| 2626 | name = "crewai" |
| 2627 | # A group can run without a subcommand, options and all (`crewai eval --models …`, |
| 2628 | # beside `crewai eval export ID`). |
| 2629 | while isinstance(command, click.Group) and args and not args[0].startswith("-"): |
| 2630 | name, *args = args |
| 2631 | subcommand = command.get_command(click.Context(command), name) |
| 2632 | assert subcommand is not None, f"unknown command {name!r}" |
| 2633 | command = subcommand |
| 2634 | command.make_context(name, args) |
| 2635 | |
| 2636 | |
| 2637 | def test_agents_md_command_parser_accepts_a_group_run_without_a_subcommand(): |
no outgoing calls
no test coverage detected