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/cformat.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/cformat.py')
-rw-r--r-- | lib/python/qmk/cli/cformat.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/cformat.py b/lib/python/qmk/cli/cformat.py index c7e93b2ab..d0d3b3b0a 100644 --- a/lib/python/qmk/cli/cformat.py +++ b/lib/python/qmk/cli/cformat.py | |||
@@ -3,6 +3,7 @@ | |||
3 | import subprocess | 3 | import subprocess |
4 | from shutil import which | 4 | from shutil import which |
5 | 5 | ||
6 | from argcomplete.completers import FilesCompleter | ||
6 | from milc import cli | 7 | from milc import cli |
7 | 8 | ||
8 | from qmk.path import normpath | 9 | from qmk.path import normpath |
@@ -33,7 +34,7 @@ def cformat_run(files, all_files): | |||
33 | 34 | ||
34 | @cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.') | 35 | @cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.') |
35 | @cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.') | 36 | @cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.') |
36 | @cli.argument('files', nargs='*', arg_only=True, help='Filename(s) to format.') | 37 | @cli.argument('files', nargs='*', arg_only=True, completer=FilesCompleter('.c'), help='Filename(s) to format.') |
37 | @cli.subcommand("Format C code according to QMK's style.", hidden=False if cli.config.user.developer else True) | 38 | @cli.subcommand("Format C code according to QMK's style.", hidden=False if cli.config.user.developer else True) |
38 | def cformat(cli): | 39 | def cformat(cli): |
39 | """Format C code according to QMK's style. | 40 | """Format C code according to QMK's style. |