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

--script (rather than -s) no longer supported #667

Open
wjt opened this issue Nov 4, 2024 · 0 comments
Open

--script (rather than -s) no longer supported #667

wjt opened this issue Nov 4, 2024 · 0 comments
Labels

Comments

@wjt
Copy link

wjt commented Nov 4, 2024

Versions

  • Godot: 4.3.stable
  • GUT: 9.3.0
  • OS: Linux

The Bug

The new option parser in GUT 9.3.0 only understands the -s short form argument to godot, not the --script long form.

Steps To Reproduce

In a project with GUT installed, run:

godot --script addons/gut/gut_cmdln.gd

The expected result is that the tests run. The actual result is that the following is printed to the terminal:

Godot Engine v4.3.stable.flathub.77dcf97d8 - https://godotengine.org
Inconsistent value (1) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
OpenGL API 4.6 (Core Profile) Mesa 24.2.5 (git-3b9fcb7e4d) - Compatibility - Using Device: Intel - Mesa Intel(R) UHD Graphics 620 (WHL GT2)

Unknown arguments:  ["--script", "addons/gut/gut_cmdln.gd"]

Changing the command line to the following works around the problem:

godot -s addons/gut/gut_cmdln.gd

In older versions, the function get_unused_options() had the following logic:

          var script_option = to_return.find("-s")
          if script_option == -1:
                  script_option = to_return.find("--script")
          if script_option != -1:
                  to_return.remove_at(script_option + 1)
                  to_return.remove_at(script_option)

In 9.3.0, the Options class has:

	var script_option = Option.new('-s', '?', 'script option provided by Godot')

# ...
	func get_by_name(option_name):
		var found_param = null
		if(option_name == script_option.option_name):
			found_param = script_option
# ...

which does not handle the --script name.

wjt added a commit to endlessm/godot-block-coding that referenced this issue Nov 4, 2024
GUT 9.3.0 does not understand the --script form.

bitwes/Gut#667
wjt added a commit to endlessm/godot-block-coding that referenced this issue Nov 4, 2024
gut's cmdline script accepts a number of command-line arguments. It
appears that the Godot engine removes most of its own options from the
argument list available to user code, but it leaves any `--script FOO`
or `-s FOO` arguments in place.

gut 9.2.1 understands both the `--script` and `-s` forms, but gut 9.3.0
only understands the `-s` form and raises an error if the `--script`
form is used.

bitwes/Gut#667
wjt added a commit to endlessm/godot-block-coding that referenced this issue Nov 6, 2024
gut's cmdline script accepts a number of command-line arguments. It
appears that the Godot engine removes most of its own options from the
argument list available to user code, but it leaves any `--script FOO`
or `-s FOO` arguments in place.

gut 9.2.1 understands both the `--script` and `-s` forms, but gut 9.3.0
only understands the `-s` form and raises an error if the `--script`
form is used.

bitwes/Gut#667
@bitwes bitwes added the bug label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants