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

Validate engine command line arguments #20000

Closed
Calinou opened this issue Jul 6, 2018 · 5 comments
Closed

Validate engine command line arguments #20000

Calinou opened this issue Jul 6, 2018 · 5 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jul 6, 2018

It was mentioned in #19683 that Godot currently does not validate engine command line arguments.

For this to be done, Godot needs to make sure project-specific arguments are not counted as invalid (as far as I know, it cannot perform that check while initializing, even if started inside a project). Engine arguments would have to be passed before a -- sequence, and project-specific arguments would be placed after the same sequence. This is common practice in some programs that accept "general" CLI arguments in addition to arguments specific to a project.

This would break compatibility with scripts that run projects with project-specific arguments, but ensures a strict separation between engine arguments and project-specific arguments. This would also prevent any conflicts that could arise between those kinds of arguments.

@bojidar-bg
Copy link
Contributor

Nice issue number, 👍 😢

@lupoDharkael
Copy link
Contributor

lupoDharkael commented Feb 20, 2019

I've started to implement a concept for this, I'm creating a WIP PR soon so we can discuss about the design.
I've written a few command parsers and this one is quite simple. Arround 210 lines of which 70 are for the help message creation alone as it creates the message based on the defined commands and its descriptions. It splits lines exceeding 80 characters and aligns content too.

Edit: I've still not implemented the mentioned separation of engine arguments from project arguments as I'd like to clarify the syntax for that.

@API-Beast
Copy link

API-Beast commented May 17, 2019

Would it be possible to introduce a configuration variable for the project that disables the engine specific command line arguments completely?

This would mean moving the detection of the mainpack and the loading of the configuration before processing the rest of the arguments.

This would very useful if you want to give your game/software a proper command line interface. Requiring the -- is not optimal for that. Especially when you want to overload arguments like "--help" for example.

@BlueG
Copy link

BlueG commented Nov 2, 2019

I think API-Beast has basically the right idea, but rather than being a project option it should be a build option. That way you can decide for a given build whether or not to include the engine's command-line options or not. They would always be enabled in the editor. When they are, then the "--" symbol will work as described by the original poster.

That being said, and not having looked through Godot's source yet, it might be difficult to run the game under some circumstances if the engine's command-line options are disabled since the engine will have already started up before the command-line processing occurs. Though how big of an issue this will be in practice, I have no idea.

@godotengine godotengine locked as resolved and limited conversation to collaborators Jun 11, 2020
@godotengine godotengine unlocked this conversation Jun 11, 2020
@Calinou
Copy link
Member Author

Calinou commented Jun 7, 2021

Closing in favor of godotengine/godot-proposals#2797, as feature proposals are now tracked on the Godot proposals repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants