Parse ARGS against the real CLI without running the command.
(args: list[str])
| 2688 | |
| 2689 | |
| 2690 | def _parse_cli_args(args: list[str]) -> None: |
| 2691 | """Parse ARGS against the real CLI without running the command.""" |
| 2692 | command: click.Command = crewai |
| 2693 | name = "crewai" |
| 2694 | # A group can run without a subcommand, options and all (`crewai eval --models …`, |
| 2695 | # beside `crewai eval export ID`). |
| 2696 | while isinstance(command, click.Group) and args and not args[0].startswith("-"): |
| 2697 | name, *args = args |
| 2698 | subcommand = command.get_command(click.Context(command), name) |
| 2699 | assert subcommand is not None, f"unknown command {name!r}" |
| 2700 | command = subcommand |
| 2701 | command.make_context(name, args) |
| 2702 | |
| 2703 | |
| 2704 | def test_agents_md_command_parser_accepts_a_group_run_without_a_subcommand(): |
no outgoing calls
no test coverage detected