summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/new
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/cli/new')
-rw-r--r--lib/python/qmk/cli/new/__init__.py1
-rwxr-xr-xlib/python/qmk/cli/new/keymap.py17
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/python/qmk/cli/new/__init__.py b/lib/python/qmk/cli/new/__init__.py
index e69de29bb2..c6a26939b8 100644
--- a/lib/python/qmk/cli/new/__init__.py
+++ b/lib/python/qmk/cli/new/__init__.py
@@ -0,0 +1 @@
+from . import keymap
diff --git a/lib/python/qmk/cli/new/keymap.py b/lib/python/qmk/cli/new/keymap.py
index b378e5ab43..5efb81c93f 100755
--- a/lib/python/qmk/cli/new/keymap.py
+++ b/lib/python/qmk/cli/new/keymap.py
@@ -6,15 +6,15 @@ import shutil
from milc import cli
-@cli.argument('-k', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
-@cli.argument('-u', '--username', help='Specify any name for the new keymap directory')
-@cli.entrypoint('Creates a new keymap for the keyboard of your choosing')
-def main(cli):
+@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
+@cli.argument('-km', '--keymap', help='Specify the name for the new keymap directory')
+@cli.subcommand('Creates a new keymap for the keyboard of your choosing')
+def new_keymap(cli):
"""Creates a new keymap for the keyboard of your choosing.
"""
# ask for user input if keyboard or username was not provided in the command line
- keyboard = cli.config.general.keyboard if cli.config.general.keyboard else input("Keyboard Name: ")
- username = cli.config.general.username if cli.config.general.username else input("Username: ")
+ keyboard = cli.config.new_keymap.keyboard if cli.config.new_keymap.keyboard else input("Keyboard Name: ")
+ keymap = cli.config.new_keymap.keymap if cli.config.new_keymap.keymap else input("Keymap Name: ")
# generate keymap paths
kb_path = os.path.join(os.getcwd(), "keyboards", keyboard)
@@ -36,6 +36,5 @@ def main(cli):
shutil.copytree(keymap_path_default, keymap_path, symlinks=True)
# end message to user
- cli.log.info("%s keymap directory created in: %s\n" +
- "Compile a firmware file with your new keymap by typing: \n" +
- "qmk compile -kb %s -km %s", username, keymap_path, keyboard, username)
+ cli.log.info("%s keymap directory created in: %s", username, keymap_path)
+ cli.log.info("Compile a firmware with your new keymap by typing: \n" + "qmk compile -kb %s -km %s", keyboard, username)