gbdev / gbdev/rgbds

At-files cannot have arguments containing spaces

Open
#1,871 0 comments 0 reactions 0 assignees View on GitHub
breaking enhancement rgbasm rgbfix rgbgfx rgblink
Dominant language
C++
Stars
1.6k
Forks
193
Avg merge
22h 17m
Merged PRs (30d)
26

Description

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`](https://docs.python.org/3/library/argparse.html#fromfile-prefix-chars) 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`](https://docs.oracle.com/en/java/javase/21/docs/specs/man/javac.html#command-line-argument-files) 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](https://codeberg.org/ISSOtm/rsgbds).

Contributor guide

Open the contributing guide

Research direction

Start at the @args.txt parsing entry point and review the two proposed syntaxes in issue 1871. Read the linked discussion for the Rust rewrite before proceeding. Done requires an agreed argument-file parsing rule that supports whitespace-containing arguments, including defined quote and escape behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.