def print_targets(tool: Process, stdout: Union[(TextIO, StreamWriter)], loading_context: LoadingContext, prefix: str='') -> None:
    'Recursively find targets for --subgraph and friends.'
    for f in ('outputs', 'inputs'):
        if tool.tool[f]:
            _logger.info('%s %s%s targets:', prefix[:(- 1)], f[0].upper(), f[1:(- 1)])
            print(('  ' + '\n  '.join([f"{prefix}{shortname(t['id'])}" for t in tool.tool[f]])), file=stdout)
    if ('steps' in tool.tool):
        loading_context = copy.copy(loading_context)
        loading_context.requirements = tool.requirements
        loading_context.hints = tool.hints
        _logger.info('%s steps targets:', prefix[:(- 1)])
        for t in tool.tool['steps']:
            print(f"  {prefix}{shortname(t['id'])}", file=stdout)
            run: Union[(str, Process, Dict[(str, Any)])] = t['run']
            if isinstance(run, str):
                process = make_tool(run, loading_context)
            elif isinstance(run, dict):
                process = make_tool(cast(CommentedMap, cmap(run)), loading_context)
            else:
                process = run
            print_targets(process, stdout, loading_context, f"{prefix}{shortname(t['id'])}/")
Recursively find targets for --subgraph and friends.
def print_targets(tool: Process, stdout: Union[(TextIO, StreamWriter)], loading_context: LoadingContext, prefix: str=) -> None:
    
    for f in ('outputs', 'inputs'):
        if tool.tool[f]:
            _logger.info('%s %s%s targets:', prefix[:(- 1)], f[0].upper(), f[1:(- 1)])
            print(('  ' + '\n  '.join([f"{prefix}{shortname(t['id'])}" for t in tool.tool[f]])), file=stdout)
    if ('steps' in tool.tool):
        loading_context = copy.copy(loading_context)
        loading_context.requirements = tool.requirements
        loading_context.hints = tool.hints
        _logger.info('%s steps targets:', prefix[:(- 1)])
        for t in tool.tool['steps']:
            print(f"  {prefix}{shortname(t['id'])}", file=stdout)
            run: Union[(str, Process, Dict[(str, Any)])] = t['run']
            if isinstance(run, str):
                process = make_tool(run, loading_context)
            elif isinstance(run, dict):
                process = make_tool(cast(CommentedMap, cmap(run)), loading_context)
            else:
                process = run
            print_targets(process, stdout, loading_context, f"{prefix}{shortname(t['id'])}/")