mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
classref: Sync with current master branch (ef34c3d)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user