aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/milc.py7
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/python/milc.py b/lib/python/milc.py
index 1a29bb25c..7b130bdea 100644
--- a/lib/python/milc.py
+++ b/lib/python/milc.py
@@ -429,11 +429,12 @@ class MILC(object):
self.arg_only.append(arg_name)
del kwargs['arg_only']
+ name = handler.__name__.replace("_", "-")
if handler is self._entrypoint:
self.add_argument(*args, **kwargs)
- elif handler.__name__ in self.subcommands:
- self.subcommands[handler.__name__].add_argument(*args, **kwargs)
+ elif name in self.subcommands:
+ self.subcommands[name].add_argument(*args, **kwargs)
else:
raise RuntimeError('Decorated function is not entrypoint or subcommand!')
@@ -599,7 +600,7 @@ class MILC(object):
self.add_subparsers()
if not name:
- name = handler.__name__
+ name = handler.__name__.replace("_", "-")
self.acquire_lock()
kwargs['help'] = description
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index c9d632517..9a9dc4b95 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -40,7 +40,7 @@ def test_pyformat():
def test_list_keyboards():
- result = check_subcommand('list_keyboards')
+ result = check_subcommand('list-keyboards')
assert result.returncode == 0
# check to see if a known keyboard is returned
# this will fail if handwired/onekey/pytest is removed