diff options
author | skydrome | 2019-11-29 01:21:39 -0500 |
---|---|---|
committer | skydrome | 2019-11-29 01:21:39 -0500 |
commit | 644190134333763d6445f8c2faf253e24badb865 (patch) | |
tree | 7bddd104738a5c7d584e3f9ccd924c85c78c9c30 | |
parent | af6430afae0fbca9dbe576eeb620dca182d67f95 (diff) | |
download | aur-644190134333763d6445f8c2faf253e24badb865.tar.gz |
add bash completion
-rw-r--r-- | .SRCINFO | 8 | ||||
-rwxr-xr-x | PKGBUILD | 18 | ||||
-rw-r--r-- | i2prouter.bash | 12 | ||||
-rwxr-xr-x | i2prouter.sh | 35 |
4 files changed, 45 insertions, 28 deletions
@@ -16,18 +16,22 @@ pkgbase = i2p-bin backup = opt/i2p/wrapper.config source = https://launchpad.net/i2p/trunk/0.9.43/+download/i2pinstall_0.9.43.jar source = https://launchpad.net/i2p/trunk/0.9.43/+download/i2pinstall_0.9.43.jar.sig + source = https://raw.githubusercontent.com/i2p/i2p.i2p/master/installer/resources/bash-completion/eepget source = i2prouter.service source = i2p.tmpfiles - source = i2prouter.sh source = wrapper.config source = router.config + source = i2prouter.bash + source = i2prouter.sh sha256sums = e5eb3db08dcc594e2fb01ada63303ff48096a454db1c7659c928ddb07736c84a sha256sums = SKIP + sha256sums = 925d931aae2bd03c08555536b1c836654a72cc4acfd9f440f1ad43958ba2108d sha256sums = 644b771ec7f5db3efab3206bf1f896566cdb00d410a54608fda85bdb4c2ad876 sha256sums = df26da04c8415ac24ec73b0dd08d3459a8964553bb77e5da5ab9833b0a31d865 - sha256sums = ae1ff9026f0a9180718249e6d8a973ffe03501bf55491cb3866d72230e89dc8a sha256sums = 5d134ee5bc614b54ec48de7c5214f6dbe08abcfab7d286c5b1c7616e39b478ed sha256sums = 7a4688db826c3dddb762976cd8c9a5d465255c3577069243d8e5af941a4126e2 + sha256sums = 7a19b9f90c8792460fd58e8b8aa435a065e34d29a942479850472510e9d3078a + sha256sums = b5f1a5bb354552acebe2857b9579410f7fd589f2f7d6b12fbbfe4127a2d33fd8 pkgname = i2p-bin @@ -25,25 +25,29 @@ validpgpkeys=('2D3D2D03910C6504C1210C65EE60C0C8EE7256A8') _url="https://launchpad.net/i2p/trunk/${pkgver}/+download" source=("${_url}/i2pinstall_${pkgver}.jar"{,.sig} - 'i2prouter.service' 'i2p.tmpfiles' 'i2prouter.sh' - 'wrapper.config' 'router.config') + 'https://raw.githubusercontent.com/i2p/i2p.i2p/master/installer/resources/bash-completion/eepget' + 'i2prouter.service' 'i2p.tmpfiles' 'wrapper.config' 'router.config' + 'i2prouter.bash' 'i2prouter.sh') sha256sums=('e5eb3db08dcc594e2fb01ada63303ff48096a454db1c7659c928ddb07736c84a' 'SKIP' + '925d931aae2bd03c08555536b1c836654a72cc4acfd9f440f1ad43958ba2108d' '644b771ec7f5db3efab3206bf1f896566cdb00d410a54608fda85bdb4c2ad876' 'df26da04c8415ac24ec73b0dd08d3459a8964553bb77e5da5ab9833b0a31d865' - 'ae1ff9026f0a9180718249e6d8a973ffe03501bf55491cb3866d72230e89dc8a' '5d134ee5bc614b54ec48de7c5214f6dbe08abcfab7d286c5b1c7616e39b478ed' - '7a4688db826c3dddb762976cd8c9a5d465255c3577069243d8e5af941a4126e2') + '7a4688db826c3dddb762976cd8c9a5d465255c3577069243d8e5af941a4126e2' + '7a19b9f90c8792460fd58e8b8aa435a065e34d29a942479850472510e9d3078a' + 'b5f1a5bb354552acebe2857b9579410f7fd589f2f7d6b12fbbfe4127a2d33fd8') package() { cd "$pkgdir" source /etc/profile.d/jre.sh echo "INSTALL_PATH=${pkgdir}/opt/i2p" >install.properties - java -jar i2pinstall_${pkgver}.jar \ + java -jar "$srcdir/i2pinstall_${pkgver}.jar" \ -options install.properties \ -language eng + rm -f install.properties install -dm755 "usr/bin" install -dm755 "opt/i2p" @@ -56,6 +60,10 @@ package() { install -Dm644 "$srcdir/router.config" "opt/i2p/router.config" install -Dm644 "$srcdir/wrapper.config" "opt/i2p/wrapper.config" install -Dm755 "$srcdir/i2prouter.sh" "opt/i2p/i2prouter" + + install -Dm644 "$srcdir/i2prouter.bash" "usr/share/bash-completion/completions/i2prouter" + install -Dm644 "$srcdir/eepget" "usr/share/bash-completion/completions/eepget" + install -Dm644 "opt/i2p/man/eepget.1" "usr/share/man/man1/eepget.1" install -Dm644 "opt/i2p/LICENSE.txt" "usr/share/licenses/i2p/LICENSE" mv opt/i2p/licenses/* "usr/share/licenses/i2p/" diff --git a/i2prouter.bash b/i2prouter.bash new file mode 100644 index 000000000000..d95158603133 --- /dev/null +++ b/i2prouter.bash @@ -0,0 +1,12 @@ +_i2prouter() +{ + local cur prev opts + _init_completion || return + + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="console start stop graceful restart dump" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) +} +complete -F _i2prouter i2prouter diff --git a/i2prouter.sh b/i2prouter.sh index 8d52e58666ea..f4e7ac9a411d 100755 --- a/i2prouter.sh +++ b/i2prouter.sh @@ -147,11 +147,6 @@ _graceful() { fi } -_status() { - [[ "$pid" ]] && - echo "I2P Router is running: PID:$pid" || echo "I2P Router is not running." -} - _dump() { if [[ "$pid" ]]; then echo "Dumping threads..." @@ -164,9 +159,22 @@ _dump() { } #----------------------------------------------------------------------------- +[[ "$1" != @(console|start|stop|graceful|restart|dump) ]] && { + echo "Usage: $(basename $0) [command]" + echo + echo "Commands:" + echo " console Launch in the current console" + echo " start Start in the background as a daemon process" + echo " stop Stop if running as a daemon or in another console" + echo " graceful Stop gracefully, may take up to 11 minutes for all tunnels to close" + echo " restart Restart the JVM" + echo " dump Request a Java thread dump if running" + exit +} + check_user "$@" -init_vars check_if_running +init_vars case "$1" in 'console') _console @@ -179,21 +187,6 @@ case "$1" in ;; 'restart') _restart ;; - 'status') _status - ;; 'dump') _dump ;; - - *) echo "Usage: $(basename $0) [command]" - echo - echo "Commands:" - echo " console Launch in the current console" - echo " start Start in the background as a daemon process" - echo " stop Stop if running as a daemon or in another console" - echo " graceful Stop gracefully, may take up to 11 minutes for all tunnels to close" - echo " restart Restart the JVM" - echo " status Query the current status" - echo " dump Request a Java thread dump if running" - echo - ;; esac |