Added highly buffered ogg123 alias oggr to .bashrc for radio streams.
[dotfiles-framework.git] / diff.sh
diff --git a/diff.sh b/diff.sh
index d10dd1d6f405fa7212384ed6ceb95a2e7d361771..2adf29c21cf3bc16ae234dc4e903f36ff0a09df7 100755 (executable)
--- a/diff.sh
+++ b/diff.sh
@@ -1,9 +1,26 @@
 #!/bin/bash
 #
-# Print diffs for each _FILE / ~/.FILE pair
+# Print diffs for each _FILE, ~/.FILE pair
+#
+# There are two modes, local and standard. In standard mode, we show the
+# transition ~/.file -> _file, which shows the changes effected by
+# `make override`.  In local mode we show the transition _file -> ~/.file,
+# which shows the changes we need to apply to the .dotfiles to create
+# your current local installation.  The --local option selects local mode.
+
+LOCAL="no" # Select diff ordering
 
+# parse options
+while [ -n "$1" ]; do
+    case "$1" in
+       "--local")
+       LOCAL="yes"
+       ;;
+    esac
+    shift
+done
 
-# Create the diff between a pair of files
+# Show the changes we'd apply on installation
 #
 # handleFile( $file, $dotfile )
 #
 # dotfile - The file it should be linked to in ~/, e.g. '.foo'
 function handleFile( )
 {
-    diff -ru $1 $2
+    if [ $LOCAL == "yes" ]; then
+       diff -ru $2 $1
+    else
+       diff -ru $1 $2
+    fi
 }
 
 # See if we can find any _files.