OSDN Git Service

Add bash completion
authora <a@b.c>
Fri, 11 Nov 2016 13:58:26 +0000 (14:58 +0100)
committera <a@b.c>
Fri, 11 Nov 2016 13:58:26 +0000 (14:58 +0100)
.gitignore
README.md
extra/bash_zsh/_pinkybar [moved from extra/zsh/_pinkybar with 99% similarity]
extra/bash_zsh/pinkybar [new file with mode: 0644]
src/Makefail.skel

index 9d96086..52847b0 100644 (file)
@@ -36,7 +36,8 @@ src/Makefile.am
 !configure.ac
 !Makefile.skel
 !extra/FreeBSD/Makefile
-!extra/zsh/_pinkybar
+!extra/bash_zsh/_pinkybar
+!extra/bash_zsh/pinkybar
 !doc/man_template.pdc
 !extra/Gentoo/app-admin/pinky/*
 !doc/Makefile
index 095302a..c1353fe 100644 (file)
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@ The order of supplied options will dictate how, where and what system informatio
 | -V           | --volume    | The sound volume level                                             |
 | -t           | --time      | The current time                                                   |
 | -a           | --ipaddr    | The local ip address [argument - eth0]                             |
-| -b           | --bandwitdh | The consumed internet bandwidth so far [argument - eth0]           |
+| -b           | --bandwidth | The consumed internet bandwidth so far [argument - eth0]           |
 | -i           | --iface     | The current download and upload speed [argument - eth0]            |
 | -A           | --ipmac     | The NIC mac address [argument - eth0]                              |
 | -B           | --ipmask    | The NIC subnet mask [argument - eth0]                              |
similarity index 99%
rename from extra/zsh/_pinkybar
rename to extra/bash_zsh/_pinkybar
index 871b4c4..e18eda0 100644 (file)
@@ -15,6 +15,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA 02110-1301, USA.
 
+# zsh completion
 # Cross-platform supported opts:
 
 _arguments -s -S -A '-*' : \
diff --git a/extra/bash_zsh/pinkybar b/extra/bash_zsh/pinkybar
new file mode 100644 (file)
index 0000000..27f2341
--- /dev/null
@@ -0,0 +1,40 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# bash completion
+
+_pinky() {
+  local cur
+  COMPREPLY=()
+  cur="${COMP_WORDS[COMP_CWORD]}"
+
+  opts1='-a -b -c -d -e -f -g -h -i -j -k -l -m -n -o -p -q -r -s -t -u -v -w -x -y -z'
+  opts2='-A -B -C -D -E -F -G -H -I -J -K -L -M -N -O -P -Q -R -S -T -U -V -W -X -Y -Z'
+  opts3='--mpd --mpdtrack --mpdartist --mpdalbum --cpu --coresload --cputemp --cpuspeed'
+  opts3+='--cpuinfo --ramperc --ramtotal --ramfree --ramshared --rambuffer --driveperc'
+  opts3+='--drivetemp --drivetotal --drivefree --driveavail --battery --dvdstr --statio'
+  opts3+='--packages --kernsys --kernode --kernrel --kernver --kernarch --kern --perl'
+  opts3+='--python --weather --uptime --loadavg --voltage --fans --mobo --mobotemp --time'
+  opts3+='--ipaddr --bandwidth --iface --ipmac --ipmask --ipcase --iplookup --drivemodel'
+  opts3+='--nicinfo --nicdrv --nicver --iplink --nicfw --wifiname'
+
+  case "$cur" in
+    -*) COMPREPLY=( $(compgen -W "${opts1} ${opts2} ${opts3}" -- "${cur}") )
+      ;;
+  esac
+
+  return 0
+}
+complete -F _pinky -o filenames pinkybar
index ed69e17..04983cf 100644 (file)
@@ -3,10 +3,6 @@ AM_CFLAGS = {amCF} \
 
 bin_PROGRAMS = pinkybar
 
-EXTRA_PROGRAMS   = ncurses
-ncurses_SOURCES  = ncurses.c
-ncurses_LDADD    = -lncurses
-
 pinkybar_LDADD = $(X_LIBS) $(ALSA_LIBS) $(MPD_LIBS) $(PCI_LIBS) $(DVD_LIBS) $(SENSORS_LIBS) $(CURL_LIBS) $(LIBNL_LZ) $(PERL_LZ) $(PYTHON_LZ) {bzdlibs}
 pinkybar_SOURCES = main.c           \
     cpu.c                           \