From 34e1fa043c59c69425e3247f6e64af42b13c1903 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Sun, 4 Dec 2022 18:22:45 -0500 Subject: [PATCH] some progress --- vimtabdiff.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/vimtabdiff.py b/vimtabdiff.py index 85a4116..08b0c63 100755 --- a/vimtabdiff.py +++ b/vimtabdiff.py @@ -1,11 +1,38 @@ #!/usr/bin/python3 import os,sys +import argparse +import pathlib +from pathlib import Path + +def parse_args(): + parser = argparse.ArgumentParser(description="Show diff in vim tab pages") + parser.add_argument("pathA") + parser.add_argument("pathB") + return parser.parse_args() + +def get_dir_info(dirname: Path): + if not dirname: + return [],[] + dirs, files = [], [] + for p in dirname.iterdir(): + if p.is_dir(): + dirs.append(p) + else: + files.append(p) + return dirs, files + +def get_file_pairs(a, b): + aDirs, aFiles = get_dir_info(a) + bDirs, bFiles = get_dir_info(b) + pass def main(): - local, remote = sys.argv[1:] + dirs, files = get_dir_info(Path('.')) + print(f"{dirs=} {files=}") + args = parse_args() print("Helloworld") - print(f"{local=} {remote=}") + print(f"{args.pathA=} {args.pathB=}") if __name__ == '__main__': main()