diff options
author | Zach White <skullydazed@gmail.com> | 2021-04-14 19:00:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 19:00:22 -0700 |
commit | 588bcdc8ca212b195a428fc43766a59a9252c08d (patch) | |
tree | 4867ef610b2178d51002063bd4913e806f771543 /lib/python/qmk/cli/__init__.py | |
parent | b33e6793de6c5f5124ee88fb3eb62d8f54f74940 (diff) | |
download | qmk_firmware-588bcdc8ca212b195a428fc43766a59a9252c08d.tar.gz qmk_firmware-588bcdc8ca212b195a428fc43766a59a9252c08d.zip |
Add support for tab completion (#12411)
* Add support for tab completion
* make flake8 happy
* Add documentation
Diffstat (limited to 'lib/python/qmk/cli/__init__.py')
-rw-r--r-- | lib/python/qmk/cli/__init__.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 1349e68a9..f7df90811 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py | |||
@@ -4,7 +4,7 @@ We list each subcommand here explicitly because all the reliable ways of searchi | |||
4 | """ | 4 | """ |
5 | import sys | 5 | import sys |
6 | 6 | ||
7 | from milc import cli | 7 | from milc import cli, __VERSION__ |
8 | 8 | ||
9 | from . import c2json | 9 | from . import c2json |
10 | from . import cformat | 10 | from . import cformat |
@@ -47,5 +47,15 @@ from . import pytest | |||
47 | # void: 3.9 | 47 | # void: 3.9 |
48 | 48 | ||
49 | if sys.version_info[0] != 3 or sys.version_info[1] < 7: | 49 | if sys.version_info[0] != 3 or sys.version_info[1] < 7: |
50 | cli.log.error('Your Python is too old! Please upgrade to Python 3.7 or later.') | 50 | print('Error: Your Python is too old! Please upgrade to Python 3.7 or later.') |
51 | exit(127) | ||
52 | |||
53 | milc_version = __VERSION__.split('.') | ||
54 | |||
55 | if int(milc_version[0]) < 2 and int(milc_version[1]) < 3: | ||
56 | from pathlib import Path | ||
57 | |||
58 | requirements = Path('requirements.txt').resolve() | ||
59 | |||
60 | print(f'Your MILC library is too old! Please upgrade: python3 -m pip install -U -r {str(requirements)}') | ||
51 | exit(127) | 61 | exit(127) |