aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-07-21 21:23:15 -0400
committerTeddy Wing2016-07-21 21:23:15 -0400
commite09b306850f080d3deeb8660243baa7ec0282f37 (patch)
tree5fa0ea38bc52ab54bb80f52befd15a1cddfab9f1
parent594318f73b5188f3d3bebfbcd9f08b69993615fa (diff)
downloadqcd-e09b306850f080d3deeb8660243baa7ec0282f37.tar.bz2
qcd: Rename `find_shortcut` function to `shortcut_exists`
This name makes more sense since it's meant for a test and doesn't return any information about the shortcut.
-rwxr-xr-xqcd4
1 files changed, 2 insertions, 2 deletions
diff --git a/qcd b/qcd
index ebd68a4..b069963 100755
--- a/qcd
+++ b/qcd
@@ -30,7 +30,7 @@ function absolute_path () {
(cd "$(dirname '$1')" &>/dev/null && printf "%s/%s" "$PWD" "${1##*/}")
}
-function find_shortcut () {
+function shortcut_exists () {
local shortcut=$1
return $(awk '{ print $1 }' $QCD_DATABASE_FILE | grep "^${shortcut}$" >/dev/null 2>&1; echo $?)
}
@@ -51,7 +51,7 @@ function qcd () {
local path=$3
# Don't add the shortcut if it already exists
- if ! find_shortcut $shortcut; then
+ if ! shortcut_exists $shortcut; then
echo "${shortcut} $(absolute_path ${path})" >> $QCD_DATABASE_FILE
fi
;;