aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-05-29 15:13:36 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-05-29 15:13:36 +1200
commit4bb9c258e8477a1752c705a8a2b596f4d168cc88 (patch)
tree7e39b1b2fcd4c2671cd5bec6b3213da1af52cf99 /bash/bashrc.d
parentAdd missing error exit conditions to vr() (diff)
downloaddotfiles-4bb9c258e8477a1752c705a8a2b596f4d168cc88.tar.gz
dotfiles-4bb9c258e8477a1752c705a8a2b596f4d168cc88.zip
Exit with 2 on usage errors like Bash builtins
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/cd.bash2
-rw-r--r--bash/bashrc.d/pd.bash4
-rw-r--r--bash/bashrc.d/prompt.bash2
-rw-r--r--bash/bashrc.d/scp.bash2
-rw-r--r--bash/bashrc.d/scr.bash2
5 files changed, 6 insertions, 6 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 908f6822..7d3fd65a 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -24,7 +24,7 @@ cd() {
else
printf 'bash: %s: could not replace substring\n' \
"$FUNCNAME" >&2
- return 1
+ return 2
fi
else
builtin cd "${opts[@]}" -- "$@"
diff --git a/bash/bashrc.d/pd.bash b/bash/bashrc.d/pd.bash
index 86a0fb18..2547c3f0 100644
--- a/bash/bashrc.d/pd.bash
+++ b/bash/bashrc.d/pd.bash
@@ -33,7 +33,7 @@ pd() {
*)
printf 'bash: %s: too many arguments\n' \
"$FUNCNAME" >&2
- return 1
+ return 2
;;
esac
if [[ $target ]] ; then
@@ -41,7 +41,7 @@ pd() {
else
printf 'bash: %s: error calculating parent directory\n' \
"$FUNCNAME" >&2
- return 1
+ return 2
fi
}
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 128717d8..d9a99c8c 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -254,7 +254,7 @@ prompt() {
# Print error
*)
printf '%s: Unknown command %s\n' "$FUNCNAME" "$1" >&2
- return 1
+ return 2
esac
}
diff --git a/bash/bashrc.d/scp.bash b/bash/bashrc.d/scp.bash
index 0d97d283..ee55061f 100644
--- a/bash/bashrc.d/scp.bash
+++ b/bash/bashrc.d/scp.bash
@@ -3,7 +3,7 @@ scp() {
if (($# >= 2)) && [[ $* != *:* ]] ; then
printf 'bash: %s: Missing colon, probably an error\n' \
"$FUNCNAME" >&2
- return 1
+ return 2
fi
command scp "$@"
}
diff --git a/bash/bashrc.d/scr.bash b/bash/bashrc.d/scr.bash
index 82d3fb5e..ff82b10a 100644
--- a/bash/bashrc.d/scr.bash
+++ b/bash/bashrc.d/scr.bash
@@ -7,7 +7,7 @@ scr() {
else
printf 'bash: %s: too many arguments\n' \
"$FUNCNAME" >&2
- return 1
+ return 2
fi
}