Skip to content

Support parsing flags and arguments from an arg file. #81

@nightowl286

Description

@nightowl286

Some CLIs support reading in arguments and flags from an arg file (probably specified through --arg-file).

Apparently the format of this file varies between CLI, but I think a good approach will be to just treat the entire input of the file as a single lazy parse fragment. New lines should already be supported as they should be handled by white-space detection.

Potential problems:

  • Would comments be useful? I could definitely have it so that lines beginning with # are treated as comments, and then manually treat the other lines as lazy fragments, although that could potentially cause problems as this widely differs from the typical case of multiple fragments meaning greedy mode instead of lazy mode parsing, so I assume there could be a few edge cases that fail.
  • Should flags still be prefixed?
  • Should arguments still be ordered, or should I require for them to be named? This would require a whole bunch of new parsing functionality though.
  • This has a big problem as text fragments and results currently assume a single source, but with the fact that there's a file involved this could be problematic in some ways.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions