qmk_firmware/lib/python/qmk/cli/list/keymaps.py
Zach White 751316c344
[CLI] Add a subcommand for getting information about a keyboard (#8666)
You can now use `qmk info` to get information about keyboards and keymaps.

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
2020-05-26 13:05:41 -07:00

22 lines
682 B
Python

"""List the keymaps for a specific keyboard
"""
from milc import cli
import qmk.keymap
from qmk.decorators import automagic_keyboard
from qmk.path import is_keyboard
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
@cli.subcommand("List the keymaps for a specific keyboard")
@automagic_keyboard
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
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)