godot-proposals icon indicating copy to clipboard operation
godot-proposals copied to clipboard

Add build option to disable all CLI options

Open ghuser404 opened this issue 9 months ago • 3 comments

Describe the project you are working on

Godot app

Describe the problem or limitation you are having in your project

Some CLI options expose too much to the user. Some developers would prefer for their users not to mess around with the settings.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allows to disable any modificaitons invocable via CLI interface.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Add a build flag, when making a custom build, which would check for #ifdef CLI_ENABLED in the code.

If this enhancement will not be used often, can it be worked around with a few lines of script?

N/A

Is there a reason why this should be core and not an add-on in the asset library?

This is core functionality.

ghuser404 avatar Mar 21 '25 05:03 ghuser404

  • Related to https://github.com/godotengine/godot-proposals/issues/11246 and https://github.com/godotengine/godot-proposals/issues/12037.

Note that https://github.com/godotengine/godot/pull/76161 disables some CLI arguments when an encrypted PCK is used.

However, I don't think we should make it easier to disable all CLI arguments, as many of them are relevant for troubleshooting purposes (e.g. forcing a certain graphics/audio driver). Some of them are also useful for convenience, like setting a window mode or resolution on startup without needing third-party utilities for doing so. In fact, some of them were even implemented with this express purpose in mind.

Note that even if you compile a custom export template with all CLI arguments disabled, it's possible for users to restore them by replacing the binary with a stock export template binary (unless you've used statically compiled C++ modules). This is possible even with PCK encryption if users have managed to extract the PCK encryption key from the original executable, as they can recompile an export template with the same key.

If you are concerned about cheating, do stuff on the server side to avoid tampering on the client side.

Calinou avatar Mar 21 '25 17:03 Calinou

I don’t think we should take care of this as godot engine unless we can clearly figure out the exact list of the cli help profiles we have to disable, keep or reduce. This will always be changing.

Given this is godot engine ran as an app, would the ideal case a custom help with zero entries?

fire avatar Mar 22 '25 11:03 fire

Yeah, I was just thinking to disable them all. But if you think about leaving some of them ON, maybe we could give user an option to selectively pick CLI options that they want to leave.

I understand the argument that some of the CLI options may be beneficial for the end user, but at the end of the day, it is the develop that's developing their game, and they should decide how to have their game function.

I just wish for Godot to be more flexible as an engine, which would allow developers to customize the end product to their own needs.

ghuser404 avatar Mar 22 '25 13:03 ghuser404

Partially implemented by godotengine/godot#108818

Repiteo avatar Oct 08 '25 19:10 Repiteo

i would also like to override the --help text, so the user can read the customized CLI options (built‑in options that are still enabled, and added custom options). of course there should also be a function to translate it into many languages, that is easy to find once i found the function to override the --help text.

sosasees avatar Oct 30 '25 09:10 sosasees