Skip to content

At-files cannot have arguments containing spaces #1871

@Rangi42

Description

@Rangi42

Currently, passing @args.txt as one argument will read multiple whitespace-separated arguments from args.txt as if they had been passed directly. The only syntax beyond that is to allow #-prefixed line comments. This means that arguments themselves cannot contain whitespace. You rarely need to, but for some arguments it matters: rgbasm -D greeting="hello world"; rgbfix --title "my new game"; any filesystem path with spaces in it; and so on.

There are some breaking changes we could choose between to allow this:

  1. Copy Python argparse and read one argument per line (so newlines would be argument separators but spaces and tabs would not). This would still not allow newlines in arguments, but that is much less likely to be necessary.
  2. Copy Java javac and allow "double quotes" to enclose arguments with whitespace. This would need more complex syntax, such as \" escapes for arguments with whitespace and double quotes, and we would have to decide how to handle double quotes in the middle of an argument (e.g. how do we parse a"b c"d -- as one argument ['a"b c"d'], two ['a"b', 'c"d'], or three ['a', 'b c', 'd']?).

See https://codeberg.org/ISSOtm/rsgbds/issues/32 for discussion of if/how to make this change in the 2.0 Rust rewrite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis is a breaking change that requires a major version updateenhancementTypically new features; lesser priority than bugsrgbasmThis affects RGBASMrgbfixThis affects RGBFIXrgbgfxThis affects RGBGFXrgblinkThis affects RGBLINK

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions