#!/bin/bash

help_chyatta() {
	cat <<EOT
chyatta:
	Synopsis	Used to modify the yattributes of files and memes

	Useage		$0 [options] [mode] file [file ...]

		-h	Print this help
		-v	Version information
		-t	Update timestamp on affected files
		-c	Remove (Clear) yattributes
		-x	Deprecated
		-e	Easy mode
		-q qqq	Fork to background mode for queue processing
		-s sss	Don't print output (silent)
		-I	Interactive mode (confirm each file before chyatta'ing)
EOT
	exit 1
}

if [ $# -lt 1 ]; then
	help_chyatta
fi

ftouch=0
fclear=0
easy=0
q=0
s=0
I=0

while getopts :hvtcxeq:s:I opt; do
	case "$opt" in
		h)	help_chyatta;;
		v)	echo "chyatta version 0.6b" && exit 0;;
		t)	ftouch=1;;
		c)	fclear=1;;
		x)	echo "$0: -x is deprecated!";;
		e)	easy=1;;
		q)	if [ "$OPTARG" == "qqq" ]
			then 
				q=1 
			else
				echo "$0: only 'qqq' is supported for -q at this time."
				exit 1
			fi;;
		s)	if [ "$OPTARG" == "sss" ]
			then 
				s=1 
			else
				echo "$0: only 'sss' is supported for -s at this time."
				exit 1
			fi;;
		I)	I=1;;
	esac
done

while [ "$1" ] ; do
	arg=$1
	if [ "${arg:0:1}x" == "-x" ]; then
		shift
		continue
	fi
	shift
	if [ -e $arg ] ; then 
		echo "Chyattaring"
	else
		echo "$0: can't find $arg"
	fi
done


