2021-07-21 00:52:14 +06:00
|
|
|
"""Point people to the new command name.
|
2020-12-10 23:01:51 +06:00
|
|
|
"""
|
2021-07-21 00:52:14 +06:00
|
|
|
import sys
|
|
|
|
from pathlib import Path
|
2020-12-10 23:01:51 +06:00
|
|
|
|
2021-07-21 00:52:14 +06:00
|
|
|
from milc import cli
|
2020-12-10 23:01:51 +06:00
|
|
|
|
|
|
|
|
2021-07-21 00:52:14 +06:00
|
|
|
@cli.subcommand('Pointer to the new command name: qmk format-text.', hidden=True)
|
2020-12-10 23:01:51 +06:00
|
|
|
def fileformat(cli):
|
2021-07-21 00:52:14 +06:00
|
|
|
"""Pointer to the new command name: qmk format-text.
|
2020-12-10 23:01:51 +06:00
|
|
|
"""
|
2021-07-21 00:52:14 +06:00
|
|
|
cli.log.warning('"qmk fileformat" has been renamed to "qmk format-text". Please use the new command in the future.')
|
|
|
|
argv = [sys.executable, *sys.argv]
|
|
|
|
argv[argv.index('fileformat')] = 'format-text'
|
|
|
|
script_path = Path(argv[1])
|
|
|
|
script_path_exe = Path(f'{argv[1]}.exe')
|
|
|
|
|
|
|
|
if not script_path.exists() and script_path_exe.exists():
|
|
|
|
# For reasons I don't understand ".exe" is stripped from the script name on windows.
|
|
|
|
argv[1] = str(script_path_exe)
|
|
|
|
|
|
|
|
return cli.run(argv, capture_output=False).returncode
|