diff --git a/diff_edit/__init__.py b/diff_edit/__init__.py index 9bf5a33..7316fed 100755 --- a/diff_edit/__init__.py +++ b/diff_edit/__init__.py @@ -27,7 +27,7 @@ __version__ = "v2022.01.03" PROJECT_NAME = "diff-edit" USAGE = f""" Usage: - {PROJECT_NAME} + {PROJECT_NAME} [] {PROJECT_NAME} -h | --help {PROJECT_NAME} --version @@ -359,7 +359,7 @@ def check_arguments(): print(__version__) sys.exit(0) for path in [arguments[""], arguments[""]]: - if not os.path.isfile(path): + if path is not None and not os.path.isfile(path): print("File does not exist:", path) sys.exit(1) return arguments[""], arguments[""] @@ -367,8 +367,12 @@ def check_arguments(): def main(): path_a, path_b = check_arguments() - editor = DiffEditor(path_a, path_b) - asyncio.run(fill3.tui(PROJECT_NAME, editor)) + if path_b is None: + editor_ = editor.Editor(path_a) + editor_.load(path_a) + else: + editor_ = DiffEditor(path_a, path_b) + asyncio.run(fill3.tui(PROJECT_NAME, editor_)) if __name__ == "__main__":