#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG					#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2011 Christopher Bratusek		#
#							#
#########################################################

if [[ $WANT_DIRINFO_FLAGS == "true" ]]; then

	if [[ $1 == --help || $1 == -h ]]; then
		$SH_CMD --help
		exit 0
	fi

	for path in "$@"; do
	    test "${path:0:1}" == - && SHO+="$path " && continue
	    for try in "$path" "${path%/*}" "$(dirname ${path})"; do
		test -e "$try"/.dirinfo || continue
		grep -q NoShred "$try"/.dirinfo || continue
		echo "can not shred $path -- it's protected!"
		continue 2
	    done
	    $SH_CMD $SH_OPTS $SHO "$path"
	done

	unset SHO

else	$SH_CMD "$@"
fi