Add README and LICENSE

This commit is contained in:
2022-12-07 18:04:27 -05:00
parent 723d6cce99
commit 6808c82c9b
3 changed files with 442 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ def star(f):
return lambda args: f(*args)
def parse_args():
parser = argparse.ArgumentParser(description="Show diff in vim tab pages")
parser = argparse.ArgumentParser(description="Show diff of files from two directories in vim tabs")
parser.add_argument("pathA")
parser.add_argument("pathB")
parser.add_argument("--vim", help="vim command to run", default="vim")
@@ -62,8 +62,11 @@ def main():
aPath = a.resolve() if a else os.devnull
bPath = b.resolve() if b else os.devnull
print(f"tabedit {aPath} | diffthis | vsp {bPath} | diffthis | diffupdate", file=vimCmdFile)
print("tabrewind | bdelete", file=vimCmdFile)
print(f"""call delete("{vimCmdFile.name}")""", file=vimCmdFile)
cmds = f"""
tabfirst | tabclose
call delete("{vimCmdFile.name}")
"""
print(cmds, file=vimCmdFile)
subprocess.run(args.vim.split() + ["-S", vimCmdFile.name])
if __name__ == '__main__':