def execute_command(dispatcher, prog_name, *args, verbose=False, dry_run=False):
    'Common entry point for command execution.'
    args = list(args)
    for (i, arg) in enumerate(args):
        if isinstance(arg, (list, tuple)):
            arg = execute_command(dispatcher, prog_name, *arg, verbose=verbose, dry_run=dry_run)
        if isinstance(arg, pathlib.PurePath):
            arg = str(arg)
        elif (not isinstance(arg, str)):
            arg = ObjectAsStr(arg)
        args[i] = arg
    if (verbose or dry_run):
        print(' '.join([shlex.quote(x) for x in (prog_name, *args)]))
    if dry_run:
        return args
    result = dispatcher(prog_name, *args)
    if (verbose and (result is not None)):
        print(ObjectAsStr.obj_to_name(result))
    return result
Common entry point for command execution.
def execute_command(dispatcher, prog_name, *args, verbose=False, dry_run=False):
    
    args = list(args)
    for (i, arg) in enumerate(args):
        if isinstance(arg, (list, tuple)):
            arg = execute_command(dispatcher, prog_name, *arg, verbose=verbose, dry_run=dry_run)
        if isinstance(arg, pathlib.PurePath):
            arg = str(arg)
        elif (not isinstance(arg, str)):
            arg = ObjectAsStr(arg)
        args[i] = arg
    if (verbose or dry_run):
        print(' '.join([shlex.quote(x) for x in (prog_name, *args)]))
    if dry_run:
        return args
    result = dispatcher(prog_name, *args)
    if (verbose and (result is not None)):
        print(ObjectAsStr.obj_to_name(result))
    return result