Skip to content

simplify response file parsing #1665

@jonsequitur

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions