classref: Sync with current master branch (ef34c3d)

This commit is contained in:
Godot Organization
2025-11-15 03:29:31 +00:00
parent e9f98b9124
commit 7b4ae2ad8c
36 changed files with 1384 additions and 215 deletions

View File

@@ -744,7 +744,13 @@ Not to be confused with :ref:`get_user_data_dir()<class_OS_method_get_user_data_
:ref:`PackedStringArray<class_PackedStringArray>` **get_cmdline_args**\ (\ ) :ref:`🔗<class_OS_method_get_cmdline_args>`
Returns the command-line arguments passed to the engine.
Returns the command-line arguments passed to the engine, excluding arguments processed by the engine, such as ``--headless`` and ``--fullscreen``.
::
# Godot has been executed with the following command:
# godot --headless --verbose --scene my_scene.tscn --custom
OS.get_cmdline_args() # Returns ["--scene", "my_scene.tscn", "--custom"]
Command-line arguments can be written in any form, including both ``--key value`` and ``--key=value`` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
@@ -806,12 +812,12 @@ Returns the command-line user arguments passed to the engine. User arguments are
::
# Godot has been executed with the following command:
# godot --fullscreen -- --level=2 --hardcore
# godot --fullscreen --custom -- --level=2 --hardcore
OS.get_cmdline_args() # Returns ["--fullscreen", "--level=2", "--hardcore"]
OS.get_cmdline_args() # Returns ["--custom"]
OS.get_cmdline_user_args() # Returns ["--level=2", "--hardcore"]
To get all passed arguments, use :ref:`get_cmdline_args()<class_OS_method_get_cmdline_args>`.
To get arguments passed before ``--`` or ``++``, use :ref:`get_cmdline_args()<class_OS_method_get_cmdline_args>`.
.. rst-class:: classref-item-separator