aboutsummaryrefslogtreecommitdiff
path: root/client/system
diff options
context:
space:
mode:
Diffstat (limited to 'client/system')
-rw-r--r--client/system/cli.gd11
1 files changed, 9 insertions, 2 deletions
diff --git a/client/system/cli.gd b/client/system/cli.gd
index efaa309a..7a312127 100644
--- a/client/system/cli.gd
+++ b/client/system/cli.gd
@@ -95,7 +95,7 @@ static func _parse_opt(args: Array[String], opt: Option) -> bool:
if args.is_empty():
push_error("missing option value")
return false
- opts[opt.long] = args[0]
+ opts[opt.long] = trim_apostrophes(args[0])
args.remove_at(0)
return true
Mode.MULTI_OPTION:
@@ -103,7 +103,7 @@ static func _parse_opt(args: Array[String], opt: Option) -> bool:
push_error("missing option value")
return false
if not opts.has(opt.long): opts[opt.long] = []
- opts[opt.long].push_back(args[0])
+ opts[opt.long].push_back(trim_apostrophes(args[0]))
args.remove_at(0)
return true
Mode.POSITIONAL:
@@ -111,3 +111,10 @@ static func _parse_opt(args: Array[String], opt: Option) -> bool:
return false
push_error("unreachable")
return false
+
+static func trim_apostrophes(s: String) -> String:
+ # Godot doesn't remove apostrophes when adding custom arguments with
+ # customize run instances in the editor. We'll have to remove them manually.
+ if OS.has_feature("editor_runtime"):
+ return s.trim_prefix("\"").trim_prefix("\'").trim_suffix("\"").trim_suffix("\'")
+ return s # Not running in editor