| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli { |
| |
| |
| ACTION=$(cli_getRepoName 'f' "$1") |
| |
| |
| |
| |
| |
| if [[ "$2" =~ '^-{1,2}[a-z]+=.+$' ]];then |
| |
| |
| OPTIONNAM=$(echo "$2" | cut -d = -f1) |
| |
| |
| OPTIONVAL=$(echo "$2" | cut -d = -f2-) |
| |
| |
| cli_checkOptionValue |
| |
| |
| |
| |
| elif [[ "$2" =~ '^-{1,2}[a-z]+=?$' ]];then |
| |
| |
| OPTIONNAM=$(echo "$2" | cut -d = -f1) |
| |
| |
| |
| |
| if [[ $(pwd) =~ '^/home/centos/artwork/.+$' ]];then |
| OPTIONVAL=$(pwd) |
| else |
| OPTIONVAL='/home/centos/artwork/trunk' |
| fi |
| |
| |
| |
| |
| else |
| |
| |
| OPTIONNAM="default" |
| |
| |
| if [[ $(pwd) =~ '^/home/centos/artwork/.+$' ]];then |
| OPTIONVAL=$(pwd) |
| else |
| OPTIONVAL='/home/centos/artwork/trunk' |
| fi |
| |
| fi |
| |
| |
| |
| |
| if [[ "$3" =~ '^--filter=.+$' ]];then |
| REGEX=$(echo "$3" | cut -d '=' -f2-) |
| else |
| REGEX='.+' |
| fi |
| |
| |
| |
| |
| |
| if [[ -f $OPTIONVAL/$REGEX ]];then |
| OPTIONVAL=$OPTIONVAL/$REGEX |
| fi |
| |
| |
| Y="`gettext "y"`" |
| |
| |
| N="`gettext "N"`" |
| |
| |
| ANSWER=${N} |
| |
| |
| |
| FILEID="centos-art$$" |
| |
| |
| |
| |
| |
| |
| |
| if [[ ! "$EDITOR" =~ '/usr/bin/(emacs|vim|nano)' ]];then |
| EDITOR='/usr/bin/vim' |
| fi |
| |
| |
| |
| |
| |
| cli_getActions "$@" |
| |
| } |