simple tree differ

This commit is contained in:
ville rantanen
2019-02-14 11:46:56 +02:00
parent 27297ebdde
commit c7eb240ee2
3 changed files with 35 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env python
import sys,os
from Tkinter import *
import Image, ImageTk, math, ImageDraw
from PIL import Image,ImageTk, ImageDraw
import math
from argparse import ArgumentParser
import sqlite3

32
files/tree-diff Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
VERSION="20190214"
function helpexit() {
BS=$( basename "$0" )
echo "Diff the filenames and sizes in two folders"
echo "Usage: $BS [-v] folder1 folder2"
echo " -v view in vimdiff"
exit
}
function _tree() {
tree -s -v "$1"
}
VIMDIFF=0
FOLDERS=( )
for ((i=1; i<=${#@}; i++)) {
[[ "${!i}" = "-h" ]] && helpexit
[[ "${!i}" = "--help" ]] && helpexit
[[ "${!i}" = "-v" ]] && { VIMDIFF=1; continue; }
FOLDERS+=( "${!i}" )
}
[[ ${#FOLDERS[@]} -eq 2 ]] || helpexit
[[ "$VIMDIFF" -eq 1 ]] && {
vimdiff <( _tree "${FOLDERS[0]}" ) <( _tree "${FOLDERS[1]}" )
} || {
diff -y <( _tree "${FOLDERS[0]}" ) <( _tree "${FOLDERS[1]}" ) | \
HB_RULES='"|.*" "$c" ".*<" "$r" ">.*" "$g"' highbeam
}