added option -n to setup script
author"Heiko Schlittermann <hs@schlittermann.de>"
Sun, 03 Jun 2012 16:33:19 +0200
changeset 1 5c0e067d6b4f
parent 0 9b555bfd927e
child 2 c519f8c9083a
added option -n to setup script
setup
--- a/setup	Sun Jun 03 15:55:21 2012 +0200
+++ b/setup	Sun Jun 03 16:33:19 2012 +0200
@@ -1,5 +1,23 @@
 #! /bin/bash
 
-command -v rsync || {
+tmp=$(getopt -n setup -o n -l nothing -- "$@") \
+	|| cat >&2 <<_
+Usage: $0 [-n|--nothing]
+_
+
+set -- $tmp
+
+while : 
+do
+	opt="$1"; shift
+	case "$opt" in
+		-n|--nothing)	opt_n=-n;;
+		--)		break;;
+	esac
+done
+
+command -v rsync &>/dev/null || {
 	zypper -n install rsync
 }
+
+rsync  $opt_n -iav --exclude setup --exclude .hg . /