Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ++ as an alternative separator to -- for user CLI arguments #68532

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Nov 11, 2022

This is required when using startx to start a Godot project, as -- is used by startx for its own arguments (and there is no way to escape it). This is specifically needed by https://github.com/godotengine/godot-benchmarks for automation purposes.

Testing project: test_cli_separator_double_slash.zip

@Calinou Calinou requested review from a team as code owners November 11, 2022 17:39
@Calinou Calinou added this to the 4.0 milestone Nov 11, 2022
@akien-mga
Copy link
Member

akien-mga commented Nov 11, 2022

// looks pretty awkward to me, especially on Unix command line where it is a valid path ls //home works like ls /home.

Maybe we could use --- instead?

Edit: Though it's not too terrible either, if others are fine with // I don't mind.
But we could maybe pick a character which doesn't have an existing meaning in usual shell/bash. See "special characters" table: https://www.oreilly.com/library/view/learning-the-bash/1565923472/ch01s09.html
E.g. ++ (opposite of --) or %%, @@.

What's the startx command you need to run exactly? Is there really no way to separate startx arguments from the launch command's arguments?

Edit: Did some tests myself, couldn't find a way aside from making a shell script.

@DarkKilauea
Copy link
Contributor

Yea, I'd rather see something other than //, since it is a valid path or looks like a comment in C derived languages.

--- seems like a reasonable workaround. The other options suggested by akien-mga seem fine too.

@Calinou
Copy link
Member Author

Calinou commented Nov 11, 2022

--- seems like a reasonable workaround. The other options suggested by akien-mga seem fine too.

--- might be intercepted by some apps (not startx specifically), and it might look like a typo at a glance.

I've changed this PR to use ++ instead of //.

@Calinou Calinou force-pushed the cmdline-user-args-add-alternative-separator branch from 4ac91a4 to 3929294 Compare November 11, 2022 21:30
@Calinou Calinou changed the title Allow // as an alternative separator to -- for user CLI arguments Allow ++ as an alternative separator to -- for user CLI arguments Nov 11, 2022
This is required when using `startx` to start a Godot project, as
`--` is used by `startx` for its own arguments (and there is no way
to escape it).
@akien-mga akien-mga merged commit 5eeb6e5 into godotengine:master Nov 28, 2022
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the cmdline-user-args-add-alternative-separator branch November 28, 2022 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants