summaryrefslogtreecommitdiffstats
path: root/python/mach
diff options
context:
space:
mode:
Diffstat (limited to 'python/mach')
-rw-r--r--python/mach/mach/command_util.py2
-rw-r--r--python/mach/mach/util.py15
2 files changed, 17 insertions, 0 deletions
diff --git a/python/mach/mach/command_util.py b/python/mach/mach/command_util.py
index 741539f6f6..e8238bd83e 100644
--- a/python/mach/mach/command_util.py
+++ b/python/mach/mach/command_util.py
@@ -134,6 +134,7 @@ MACH_COMMANDS = {
"mach-debug-commands": MachCommandReference(
"python/mach/mach/commands/commandinfo.py"
),
+ "macos-sign": MachCommandReference("tools/signing/macos/mach_commands.py"),
"manifest": MachCommandReference("testing/mach_commands.py"),
"marionette-test": MachCommandReference("testing/marionette/mach_commands.py"),
"mochitest": MachCommandReference("testing/mochitest/mach_commands.py", ["test"]),
@@ -203,6 +204,7 @@ MACH_COMMANDS = {
),
"tps-build": MachCommandReference("testing/tps/mach_commands.py"),
"try": MachCommandReference("tools/tryselect/mach_commands.py"),
+ "ts": MachCommandReference("tools/ts/mach_commands.py"),
"uniffi": MachCommandReference(
"toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py"
),
diff --git a/python/mach/mach/util.py b/python/mach/mach/util.py
index 203f08f92b..b6bf1727fa 100644
--- a/python/mach/mach/util.py
+++ b/python/mach/mach/util.py
@@ -115,3 +115,18 @@ def to_optional_str(path: Optional[Path]):
return str(path)
else:
return None
+
+
+def strtobool(value: str):
+ # Reimplementation of distutils.util.strtobool
+ # https://docs.python.org/3.9/distutils/apiref.html#distutils.util.strtobool
+ true_vals = ("y", "yes", "t", "true", "on", "1")
+ false_vals = ("n", "no", "f", "false", "off", "0")
+
+ value = value.lower()
+ if value in true_vals:
+ return 1
+ if value in false_vals:
+ return 0
+
+ raise ValueError(f'Expected one of: {", ".join(true_vals + false_vals)}')