changeset 185:6d926d4b3c5a

initial clean system support
author edhoprima@gmail.com <edhoprima@gmail.com>
date Sun, 28 Jun 2009 13:10:28 +0000
parents d94e789fd092
children 197266fefbb4
files moefetch.sh
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/moefetch.sh	Sun Jun 28 13:01:35 2009 +0000
+++ b/moefetch.sh	Sun Jun 28 13:10:28 2009 +0000
@@ -249,22 +249,29 @@
 	esac
 	shift
 	SITE=
-	case "$1" in
-		-s|--site)
-			shift
-			SITE="$1"
-			shift
-		;;
-		*)
-			SITE="${DEFAULT_SITE}"
-		;;
-	esac
+	TAGS=
+	while [ "${1}" ]; do
+		case "$1" in
+			-s|--site)
+				shift
+				SITE="$1"
+			;;
+			-nc|--noclean)
+				NOCLEAN=1
+			;;
+			*)
+				TAGS="$1 ${TAGS}"
+			;;
+		esac
+		shift
+	done
+	[ "${SITE}" ] || SITE="${DEFAULT_SITE}"
+	[ "${TAGS}" ] || Err_Fatal "No tag specified"
 	# Get base folder - default, current folder or fallback to ${HOME}
 	[ "${BASE_DIR}"	] || BASE_DIR="${PWD}"
 	[ "${BASE_DIR}" ] || BASE_DIR="{$HOME}"
 	[ "`echo ${BASE_DIR} | cut -c1 | grep \/`" ] || BASE_DIR="/${BASE_DIR}"	
 
-	TAGS="$@"
 	echo "Tags: ${TAGS}"
 	# slash is not wanted for folder name
 	TARGET_DIR="`echo "${TAGS}" | sed -e 's/\//_/g'`"