Skip to content

Commit

Permalink
compton-trans: allow long option names.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed May 5, 2013
1 parent b0db9f4 commit 7c451c1
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion bin/compton-trans
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,27 @@ while test $# -gt 0; do
OPTIND=1

# Read options
while getopts 'scdgn:w:o:' option "$@"; do
while getopts 'scdgn:w:o:-:' option "$@"; do
if test "$option" = '-'; then
case "$OPTARG" in
select | current | delete | get)
v=''
;;
name | window | opacity)
eval v=\$$OPTIND
OPTIND=$((OPTIND + 1))
;;
name=* | window=* | opacity=*)
v=$(echo "$OPTARG" | sed 's/^[^=]\+=//')
;;
*)
echo "$0: illegal option $OPTARG" >& 2
exit 1
;;
esac
option=$(echo "$OPTARG" | cut -c 1)
OPTARG=$v
fi
case "$option" in
s) wprefix=''; window='' ;;
c)
Expand Down

0 comments on commit 7c451c1

Please sign in to comment.