Skip to content

simplify response file parsing #1665

Closed
Closed

Description

@jonsequitur

Response file parsing can currently be customized by a developer using System.CommandLine using the CommandLineBuilder.ParseRespondFilesAs(ResponseFileHandling) method. The ResponseFileHandling enum provides two modes (in addition to Disabled) but the behavior is not apparent to end users, and is occasionally surprising.

The proposal is to support only a single response file parsing behavior by removing the existing methods and supporting only enable/disable. The new behavior would follow these rules:

  • Multiple-line files will be parsed treating newlines as equivalent to spaces.
  • Multiple tokens on a single line will be parsed as though passed verbatim on the command line.
    • Including a space within a token will now require enclosing the token in quotes, e.g. "this is one token".
    • Shell-specific escaping of quotes will not be required.
  • Allow comment lines using a # prefix at the beginning of the line

Open questions:

  • How should quotation marks be escaped?

Activity

  1. added this to the 2.0 GA milestone on Mar 6, 2022
  2. KathleenDollard commented on Mar 7, 2022

    @KathleenDollard
    Contributor

    What's the prior art. Multiple double quotes in C# and & in HTML?

  3. self-assigned this
    on Apr 19, 2022
  4. marek-safar commented on Apr 21, 2022

    @marek-safar

    This is a breaking change that breaks .net6 servicing builds. Was it really intentional when there is no version bump?

  5. added a commit that references this issue on Mar 6, 2024
    dd44dd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions