Add support for tab completion (#12411)
* Add support for tab completion * make flake8 happy * Add documentation
This commit is contained in:
parent
b33e6793de
commit
588bcdc8ca
23 changed files with 168 additions and 85 deletions
|
@ -3,6 +3,7 @@
|
|||
import subprocess
|
||||
from shutil import which
|
||||
|
||||
from argcomplete.completers import FilesCompleter
|
||||
from milc import cli
|
||||
|
||||
from qmk.path import normpath
|
||||
|
@ -33,7 +34,7 @@ def cformat_run(files, all_files):
|
|||
|
||||
@cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.')
|
||||
@cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.')
|
||||
@cli.argument('files', nargs='*', arg_only=True, help='Filename(s) to format.')
|
||||
@cli.argument('files', nargs='*', arg_only=True, completer=FilesCompleter('.c'), help='Filename(s) to format.')
|
||||
@cli.subcommand("Format C code according to QMK's style.", hidden=False if cli.config.user.developer else True)
|
||||
def cformat(cli):
|
||||
"""Format C code according to QMK's style.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue