diff options
| -rw-r--r-- | docs/cli.md | 4 | ||||
| -rw-r--r-- | lib/python/milc.py | 7 | ||||
| -rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/docs/cli.md b/docs/cli.md index d150ee917..0d3703c8c 100644 --- a/docs/cli.md +++ b/docs/cli.md | |||
| @@ -125,14 +125,14 @@ This command examines your environment and alerts you to potential build or flas | |||
| 125 | qmk doctor | 125 | qmk doctor |
| 126 | ``` | 126 | ``` |
| 127 | 127 | ||
| 128 | ## `qmk list_keyboards` | 128 | ## `qmk list-keyboards` |
| 129 | 129 | ||
| 130 | This command lists all the keyboards currently defined in `qmk_firmware` | 130 | This command lists all the keyboards currently defined in `qmk_firmware` |
| 131 | 131 | ||
| 132 | **Usage**: | 132 | **Usage**: |
| 133 | 133 | ||
| 134 | ``` | 134 | ``` |
| 135 | qmk list_keyboards | 135 | qmk list-keyboards |
| 136 | ``` | 136 | ``` |
| 137 | 137 | ||
| 138 | ## `qmk new-keymap` | 138 | ## `qmk new-keymap` |
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): | |||
| 429 | self.arg_only.append(arg_name) | 429 | self.arg_only.append(arg_name) |
| 430 | del kwargs['arg_only'] | 430 | del kwargs['arg_only'] |
| 431 | 431 | ||
| 432 | name = handler.__name__.replace("_", "-") | ||
| 432 | if handler is self._entrypoint: | 433 | if handler is self._entrypoint: |
| 433 | self.add_argument(*args, **kwargs) | 434 | self.add_argument(*args, **kwargs) |
| 434 | 435 | ||
| 435 | elif handler.__name__ in self.subcommands: | 436 | elif name in self.subcommands: |
| 436 | self.subcommands[handler.__name__].add_argument(*args, **kwargs) | 437 | self.subcommands[name].add_argument(*args, **kwargs) |
| 437 | 438 | ||
| 438 | else: | 439 | else: |
| 439 | raise RuntimeError('Decorated function is not entrypoint or subcommand!') | 440 | raise RuntimeError('Decorated function is not entrypoint or subcommand!') |
| @@ -599,7 +600,7 @@ class MILC(object): | |||
| 599 | self.add_subparsers() | 600 | self.add_subparsers() |
| 600 | 601 | ||
| 601 | if not name: | 602 | if not name: |
| 602 | name = handler.__name__ | 603 | name = handler.__name__.replace("_", "-") |
| 603 | 604 | ||
| 604 | self.acquire_lock() | 605 | self.acquire_lock() |
| 605 | kwargs['help'] = description | 606 | 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(): | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | def test_list_keyboards(): | 42 | def test_list_keyboards(): |
| 43 | result = check_subcommand('list_keyboards') | 43 | result = check_subcommand('list-keyboards') |
| 44 | assert result.returncode == 0 | 44 | assert result.returncode == 0 |
| 45 | # check to see if a known keyboard is returned | 45 | # check to see if a known keyboard is returned |
| 46 | # this will fail if handwired/onekey/pytest is removed | 46 | # this will fail if handwired/onekey/pytest is removed |
