Add --window flag for native GPU window mode
This commit is contained in:
parent
aeb5d36802
commit
f90b0a2cd6
1 changed files with 7 additions and 3 deletions
|
|
@ -36,6 +36,7 @@ Usage:
|
|||
{PROJECT_NAME} --git <file-a>
|
||||
{PROJECT_NAME} -h | --help
|
||||
{PROJECT_NAME} --version
|
||||
--window Use a native GPU window instead of the terminal.
|
||||
|
||||
Example:
|
||||
# {PROJECT_NAME} project.py.bak project.py
|
||||
|
|
@ -401,11 +402,11 @@ def check_arguments():
|
|||
if path is not None and not os.path.isfile(path):
|
||||
print("File does not exist:", path)
|
||||
sys.exit(1)
|
||||
return arguments["<file-a>"], arguments["<file-b>"], arguments["--git"]
|
||||
return arguments["<file-a>"], arguments["<file-b>"], arguments["--git"], arguments["--window"]
|
||||
|
||||
|
||||
def main():
|
||||
path_a, path_b, is_git_mode = check_arguments()
|
||||
path_a, path_b, is_git_mode, use_window = check_arguments()
|
||||
if path_b is None:
|
||||
if is_git_mode:
|
||||
editor_ = DiffEditor.from_git(path_a)
|
||||
|
|
@ -414,6 +415,9 @@ def main():
|
|||
editor_.load(path_a)
|
||||
else:
|
||||
editor_ = DiffEditor(path_a, path_b)
|
||||
if use_window:
|
||||
asyncio.run(fill3.textgrid_tui(PROJECT_NAME, editor_))
|
||||
else:
|
||||
asyncio.run(fill3.tui(PROJECT_NAME, editor_))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue