MCPcopy
hub / github.com/aws/aws-cli / __call__

Method __call__

awscli/alias.py:360–392  ·  view source on GitHub ↗
(self, args, parsed_globals)

Source from the content-addressed store, hash-verified

358 self._shadow_proxy_command = shadow_proxy_command
359
360 def __call__(self, args, parsed_globals):
361 alias_args = self._get_alias_args()
362 parsed_alias_args, remaining = self._parser.parse_known_args(
363 alias_args
364 )
365 self._update_parsed_globals(
366 self._parser, parsed_alias_args, parsed_globals
367 )
368 # Take any of the remaining arguments that were not parsed out and
369 # prepend them to the remaining args provided to the alias.
370 remaining.extend(args)
371 LOG.debug(
372 'Alias %r passing on arguments: %r to %r command',
373 self._alias_name,
374 remaining,
375 parsed_alias_args.command,
376 )
377 # Pass the update remaining args and global args to the service command
378 # the alias proxied to.
379 command = self._command_table[parsed_alias_args.command]
380 if self._shadow_proxy_command:
381 shadow_name = self._shadow_proxy_command.name
382 # Use the shadow command only if the aliases value
383 # uses that command indicating it needs to proxy over to
384 # a built-in command.
385 if shadow_name == parsed_alias_args.command:
386 LOG.debug(
387 'Using shadowed command object: %s for alias: %s',
388 self._shadow_proxy_command,
389 self._alias_name,
390 )
391 command = self._shadow_proxy_command
392 return command(remaining, parsed_globals)
393
394
395class ExternalAliasCommand(BaseAliasCommand):

Callers

nothing calls this directly

Calls 4

commandFunction · 0.85
_get_alias_argsMethod · 0.80
parse_known_argsMethod · 0.45

Tested by

no test coverage detected