Commit graph

17 commits

Author SHA1 Message Date
Zach White
b0069c5c05
Begin the process of deprecating bin/qmk in favor of the global cli (#12109)
* Begin the process of deprecating bin/qmk in favor of the global cli

* Correctly set the qmk bin
2021-03-07 19:10:03 -08:00
Erovia
7db826dce8
CLI: Fix json flashing (#11765) 2021-02-01 20:55:35 +01:00
Zach White
111eb8990d
Fix QMK_BUILDDATE (#11641) 2021-01-20 20:38:18 +00:00
Zach White
da40242dbc
Generate version.h when compiling json files (#11581)
* generate version.h when compiling json files

* make flake8 happy

* fix formatting and verbose

* quiet up the compile output
2021-01-17 17:33:29 +00:00
Zach White
d9785ec313
Improve the compile and flash subcommands (#11334)
* add support for --clean to compile and flash

* compile standalone JSON keymaps without polluting the tree

* Add support for passing environment vars to make

* make flake8 happy

* document changes to qmk compile and flash

* add -e support to json export compiling

* Fix python 3.6

* honor $MAKE

* add support for parallel builds
2021-01-16 15:13:04 -08:00
Ryan
f9bd9d3b26
c2json: Fix TypeError on MSYS2 (#10709) 2020-10-23 12:21:32 +11:00
Erovia
058737f116
[CLI] Add c2json (#8817)
* Basic keymap parsing finally works

* Add 'keymap.json' creation to the qmk.keymap module

* Add tests and fix formatting

* Fix/exclude flake8 errors

* Convert keymap.c to valid keymap.json

* Fix some errors

* Add tests

* Finalize keymap.json creation, add json template

* Add docs

* Move pygments to the standard requirements

* Add support for nameless layers, fix tests

* Fix things after rebase

* Add missing 'keymap' value.

* Fix missing layer numbers from advanced keycodes

Buckwich noticed that if the advanced keycode / layer toggling key
contains a number, it goes missing.
Now we properly handle them.
Thx for noticing!

* Apply suggestions from code review

* fixup tests

Co-authored-by: Zach White <skullydazed@drpepper.org>
Co-authored-by: skullY <skullydazed@gmail.com>
2020-10-06 17:10:19 -07:00
Ryan
0f9b7b9768
Add debug logging to run() (#9986) 2020-08-28 08:03:42 -07:00
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
Pete Johanson
6fb048fdaf CLI: Use shutil.which to detect gmake, instead of OS check. 2020-04-13 10:48:27 -07:00
Pete Johanson
06b571aa53 CLI: Invoke gmake on FreeBSD when using qmk compile.
* Current makefiles aren't portable, so invoke gmake on FreeBSD.
2020-04-13 10:48:27 -07:00
Erovia
c89c084146
CLI: More MSYS2 fixes (#8577)
* CLI: More MSYS2 fixes

Now I can fully setup and work with qmk_firmware on an MSYS2
installation without any errors or exceptions.

* Apply suggestions from code review

Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com>

* Some improvements

* Remove unnecessary import

* Remove slow, unused code

Getting the version from GIT was slow on both Windows and Docker.
Until we find a better, faster way, this is removed.

* remove unused imports

* Implement @vomindoraan's suggestions

* refine how we pick the shell to use

* Apply @fauxpark's suggestions

fauxpark investigated the topic of shells in MSYS2 a bit and we come to the conclusion that the safest bet was to just use the user's shell.
Anything more just opens up more edge-cases than it solves.

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Use `platform_id` in doctor

This will bring it in line with the new code.

Co-authored-by: skullydazed <skullydazed@users.noreply.github.com>
Co-authored-by: skullY <skullydazed@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
2020-03-29 14:29:44 +02:00
skullydazed
f81b0e35a6
Add decorators for determining keyboard and keymap based on current directory (#8191)
* Use pathlib everywhere we can

* Improvements based on @erovia's feedback

* rework qmk compile and qmk flash to use pathlib

* style

* Remove the subcommand_name argument from find_keyboard_keymap()

* add experimental decorators

* Create decorators for finding keyboard and keymap based on current directory.

Decorators were inspired by @Erovia's brilliant work on the proof of concept.
2020-03-13 15:47:04 -07:00
skullydazed
c66930445f
Use pathlib everywhere we can (#7872)
* Use pathlib everywhere we can

* Update lib/python/qmk/path.py

Co-Authored-By: Erovia <Erovia@users.noreply.github.com>

* Update lib/python/qmk/path.py

Co-Authored-By: Erovia <Erovia@users.noreply.github.com>

* Improvements based on @erovia's feedback

* rework qmk compile and qmk flash to use pathlib

* style

* Remove the subcommand_name argument from find_keyboard_keymap()

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
2020-02-17 11:42:11 -08:00
Zach White
033c7af292 Fix compiling json files 2019-12-08 16:40:03 -08:00
QMK Bot
7891de7f6d format code according to conventions [skip ci] 2019-11-16 07:10:19 +00:00
jorgemanzo
897888db41 Add CLI command for flashing a keyboard
A new CLI subcommand was added, flash, which behaves very similar to the already present compile CLI comamnd, but with the added ability to target a bootloader. The command is used like so: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename].

A -kb <keyboard> and -km <keymap> is expected, or a configurator export JSON filename. A bootloader can be specified using -bl <target>, and if left unspecified, the target is assumed to be :flash. -bl can be used to list the available bootloaders.

If -km <keymap> is provided, but no -kb <keyboard>, then a message is printed suggesting the user to run qmk list_keyboards.
2019-11-15 23:06:07 -08:00