2019-10-08 21:50:21 +02:00
|
|
|
"""List the keymaps for a specific keyboard
|
|
|
|
"""
|
|
|
|
from milc import cli
|
2020-03-13 23:47:04 +01:00
|
|
|
|
2019-10-13 19:07:22 +02:00
|
|
|
import qmk.keymap
|
2020-03-13 23:47:04 +01:00
|
|
|
from qmk.decorators import automagic_keyboard
|
2020-05-26 22:05:41 +02:00
|
|
|
from qmk.path import is_keyboard
|
2019-10-09 10:14:53 +02:00
|
|
|
|
2020-01-07 21:54:21 +01:00
|
|
|
|
2019-10-09 20:53:18 +02:00
|
|
|
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
|
2019-10-08 21:50:21 +02:00
|
|
|
@cli.subcommand("List the keymaps for a specific keyboard")
|
2020-03-13 23:47:04 +01:00
|
|
|
@automagic_keyboard
|
2019-10-08 21:50:21 +02:00
|
|
|
def list_keymaps(cli):
|
|
|
|
"""List the keymaps for a specific keyboard
|
|
|
|
"""
|
2020-05-26 22:05:41 +02:00
|
|
|
if not is_keyboard(cli.config.list_keymaps.keyboard):
|
|
|
|
cli.log.error('Keyboard %s does not exist!', cli.config.list_keymaps.keyboard)
|
|
|
|
exit(1)
|
|
|
|
|
|
|
|
for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
|
|
|
|
print(name)
|