diff --git a/Makefile b/Makefile index cb824f5..95abf8c 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,12 @@ LDLIBS = -ldl CFLAGS_LIB = $(filter-out -fPIE -fpie -pie,$(CFLAGS)) -fPIC LDFLAGS_LIB = $(filter-out -fPIE -fpie -pie,$(LDFLAGS)) -fPIC -prefix ?= /usr/local -libdir ?= $(prefix)/lib -bindir ?= $(prefix)/bin -mandir ?= $(prefix)/share/man +prefix ?= /usr/local +libdir ?= $(prefix)/lib +bindir ?= $(prefix)/bin +datadir ?= ${prefix}/share +mandir ?= $(datadir)/man +bashcompletiondir ?= ${datadir}/bash-completion/completions all: libgtk3-nocsd.so.0 gtk3-nocsd @@ -30,6 +32,7 @@ install: install -D -m 0644 libgtk3-nocsd.so.0 $(DESTDIR)$(libdir)/libgtk3-nocsd.so.0 install -D -m 0755 gtk3-nocsd $(DESTDIR)$(bindir)/gtk3-nocsd install -D -m 0644 gtk3-nocsd.1 $(DESTDIR)$(mandir)/man1/gtk3-nocsd.1 + install -D -m 0644 gtk3-nocsd.bash-completion $(DESTDIR)$(bashcompletiondir)/gtk3-nocsd check: libgtk3-nocsd.so.0 testlibs/stamp test-static-tls @echo "RUNNING: test-static-tls" diff --git a/gtk3-nocsd.bash-completion b/gtk3-nocsd.bash-completion new file mode 100644 index 0000000..88a0172 --- /dev/null +++ b/gtk3-nocsd.bash-completion @@ -0,0 +1,34 @@ +# gtk3-nocsd bash completion module +# +# Copyright (C) 2014 Hong Jen Yee (PCMan) +# +# http://lxqt.org/ +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +_gtk3_nocsd() { + local cur=${COMP_WORDS[COMP_CWORD]} + local OPTS='-h --help' + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + local command=${COMP_WORDS[i]} + _command_offset $i + return + fi + done + COMPREPLY=( $(compgen -W "$OPTS" -- "$cur") ) + return 0 +} +complete -F _gtk3_nocsd gtk3-nocsd