MCPcopy Index your code
hub / github.com/google/adk-python / parse_args

Method parse_args

src/google/adk/cli/cli_tools_click.py:199–220  ·  view source on GitHub ↗

Override the parse_args method to show help text on error. Args: ctx: Click context object for the current command. args: List of command-line arguments to parse. Returns: The parsed arguments as returned by the parent class's parse_args method. Raises: click.M

(self, ctx, args)

Source from the content-addressed store, hash-verified

197 return f"Missing required argument: {name.upper()}"
198
199 def parse_args(self, ctx, args):
200 """Override the parse_args method to show help text on error.
201
202 Args:
203 ctx: Click context object for the current command.
204 args: List of command-line arguments to parse.
205
206 Returns:
207 The parsed arguments as returned by the parent class's parse_args method.
208
209 Raises:
210 click.MissingParameter: When a required parameter is missing, but this
211 is caught and handled by displaying the help text before exiting.
212 """
213 try:
214 return super().parse_args(ctx, args)
215 except click.MissingParameter as exc:
216 error_message = self._format_missing_arg_error(exc)
217
218 click.echo(ctx.get_help())
219 click.secho(f"\nError: {error_message}", fg="red", err=True)
220 ctx.exit(2)
221
222
223logger = logging.getLogger("google_adk." + __name__)

Callers 13

process_argumentsFunction · 0.80
process_argumentsFunction · 0.80
mainFunction · 0.80
get_humidity.pyFile · 0.80
get_humidity.pyFile · 0.80
get_humidity.pyFile · 0.80
process_argumentsFunction · 0.80
process_argumentsFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

exitMethod · 0.80

Tested by

no test coverage detected