summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli/list/keymaps.py
blob: 49bc84b2cecda41cf67a20f807afa6e71bf7118d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""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)
        return False

    for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
        print(name)