aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:32:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-01 02:32:30 +1300
commitc3af0c31efbc23472a103536280a4d839555e198 (patch)
tree4a60248435bb69dde9f3e4314d56fab67f36e36d
parent0681de59778f82c9006de70ed9a9ee6644fd4a18 (diff)
downloaddotfiles-c3af0c31efbc23472a103536280a4d839555e198.tar.gz
Remove redundant error code in short circuits
-rw-r--r--bash/bash_completion.d/bd.bash4
-rw-r--r--bash/bash_completion.d/ftp.bash2
-rw-r--r--bash/bash_completion.d/gpg.bash2
-rw-r--r--bash/bash_completion.d/man.bash2
-rw-r--r--bash/bash_completion.d/mysql.bash4
-rw-r--r--bash/bash_completion.d/pass.bash2
-rw-r--r--bash/bash_completion.d/sd.bash2
-rw-r--r--bash/bash_completion.d/ud.bash2
8 files changed, 10 insertions, 10 deletions
diff --git a/bash/bash_completion.d/bd.bash b/bash/bash_completion.d/bd.bash
index 120080c3..e67cdd09 100644
--- a/bash/bash_completion.d/bd.bash
+++ b/bash/bash_completion.d/bd.bash
@@ -2,14 +2,14 @@
_bd() {
# Only makes sense for the first argument
- ((COMP_CWORD == 1)) || return 1
+ ((COMP_CWORD == 1)) || return
# Build a list of dirnames in $PWD
local -a dirnames
IFS=/ read -rd '' -a dirnames < <(printf '%s\0' "${PWD#/}")
# Remove the last element in the array (the current directory)
- ((${#dirnames[@]})) || return 1
+ ((${#dirnames[@]})) || return
dirnames=("${dirnames[@]:0:${#dirnames[@]}-1}")
# Add the matching dirnames to the reply
diff --git a/bash/bash_completion.d/ftp.bash b/bash/bash_completion.d/ftp.bash
index d7ee8963..a584dd81 100644
--- a/bash/bash_completion.d/ftp.bash
+++ b/bash/bash_completion.d/ftp.bash
@@ -4,7 +4,7 @@ _ftp() {
# Bail if the .netrc file is illegible
local netrc
netrc=$HOME/.netrc
- [[ -r $netrc ]] || return 1
+ [[ -r $netrc ]] || return
# Tokenize the file
local -a tokens
diff --git a/bash/bash_completion.d/gpg.bash b/bash/bash_completion.d/gpg.bash
index 0f6785f9..697e4a65 100644
--- a/bash/bash_completion.d/gpg.bash
+++ b/bash/bash_completion.d/gpg.bash
@@ -2,7 +2,7 @@
_gpg() {
# Bail if no gpg(1)
- hash gpg 2>/dev/null || return 1
+ hash gpg 2>/dev/null || return
# Bail if not completing an option
case ${COMP_WORDS[COMP_CWORD]} in
diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash
index 7574db40..e4175837 100644
--- a/bash/bash_completion.d/man.bash
+++ b/bash/bash_completion.d/man.bash
@@ -2,7 +2,7 @@
_man() {
# Don't even bother if we don't have manpath(1)
- hash manpath 2>/dev/null || return 1
+ hash manpath 2>/dev/null || return
# Snarf the word
local word
diff --git a/bash/bash_completion.d/mysql.bash b/bash/bash_completion.d/mysql.bash
index 413f3386..3ff97090 100644
--- a/bash/bash_completion.d/mysql.bash
+++ b/bash/bash_completion.d/mysql.bash
@@ -2,12 +2,12 @@
_mysql() {
# Only makes sense for first argument
- ((COMP_CWORD == 1)) || return 1
+ ((COMP_CWORD == 1)) || return
# Bail if directory doesn't exist
local dirname
dirname=$HOME/.mysql
- [[ -d $dirname ]] || return 1
+ [[ -d $dirname ]] || return
# Return the names of the .cnf files sans prefix as completions
local db
diff --git a/bash/bash_completion.d/pass.bash b/bash/bash_completion.d/pass.bash
index 1df8dfb1..176886dc 100644
--- a/bash/bash_completion.d/pass.bash
+++ b/bash/bash_completion.d/pass.bash
@@ -8,7 +8,7 @@ _pass()
# If we can't read the password directory, just bail
local passdir
passdir=${PASSWORD_STORE_DIR:-"$HOME"/.password-store}
- [[ -r $passdir ]] || return 1
+ [[ -r $passdir ]] || return
# Iterate through list of .gpg paths, extension stripped, null-delimited,
# and filter them down to the ones matching the completing word (compgen
diff --git a/bash/bash_completion.d/sd.bash b/bash/bash_completion.d/sd.bash
index 1194b33a..e7e82f80 100644
--- a/bash/bash_completion.d/sd.bash
+++ b/bash/bash_completion.d/sd.bash
@@ -2,7 +2,7 @@
_sd() {
# Only makes sense for the first argument
- ((COMP_CWORD == 1)) || return 1
+ ((COMP_CWORD == 1)) || return
# Current directory can't be root directory
case $PWD in
diff --git a/bash/bash_completion.d/ud.bash b/bash/bash_completion.d/ud.bash
index 9ded41e6..5170eb57 100644
--- a/bash/bash_completion.d/ud.bash
+++ b/bash/bash_completion.d/ud.bash
@@ -2,7 +2,7 @@
_ud() {
# Only makes sense for the second argument
- ((COMP_CWORD == 2)) || return 1
+ ((COMP_CWORD == 2)) || return
# Iterate through directories, null-separated, add them to completions
local dirname