Skip to content

Allow disabling pattern expansion on Windows #1901

@ofek

Description

@ofek

TL;DR

Essentially, make this optional: #1830

Use case

We have a command that passes arbitrary arguments to be executed in other contexts such as Docker containers, servers over SSH, etc.

On Windows since Click 8.0 this breaks (depending on files in cwd, etc.) and unlike on Linux we can't just escape special characters

Implementation

Setting could be called disable_pattern_expansion, e.g.:

import click


@click.command(
    context_settings={'help_option_names': [], 'ignore_unknown_options': True, 'disable_pattern_expansion': True},
)
@click.argument('args', required=True, nargs=-1)
@click.pass_obj
def run(app, args):
    environment = app.get_environment()
    environment.send_command(args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions