aboutsummaryrefslogtreecommitdiffstats
path: root/bash_completion
diff options
context:
space:
mode:
authorPierre Fenoll <[email protected]>2016-01-10 18:03:30 +0100
committerPierre Fenoll <[email protected]>2016-01-10 20:11:15 +0100
commit29d7e61222a231f8eaff3b294d0578a511f3f1c6 (patch)
treee02a8e8cfa7efa4afb122d04006999d3332279a1 /bash_completion
parent4e7c4349ddcd46ac11cd4cd50bfbda25f1f11ca2 (diff)
downloadkerl-29d7e61222a231f8eaff3b294d0578a511f3f1c6.tar.gz
kerl-29d7e61222a231f8eaff3b294d0578a511f3f1c6.tar.bz2
kerl-29d7e61222a231f8eaff3b294d0578a511f3f1c6.zip
Fix most shellcheck warnings/errors
Diffstat (limited to 'bash_completion')
-rw-r--r--bash_completion/kerl26
1 files changed, 13 insertions, 13 deletions
diff --git a/bash_completion/kerl b/bash_completion/kerl
index 559d844..76c4ad2 100644
--- a/bash_completion/kerl
+++ b/bash_completion/kerl
@@ -1,3 +1,4 @@
+#!/bin/bash
# bash_completion for kerl
_kerl()
@@ -14,33 +15,33 @@ _kerl()
;;
build)
if [ "$COMP_CWORD" -eq 2 ]; then
- if [ -f "$HOME/.kerl/otp_releases" ]; then
- RELEASES=`cat "$HOME/.kerl/otp_releases"`
+ if [ -f "$HOME"/.kerl/otp_releases ]; then
+ RELEASES=$(cat "$HOME"/.kerl/otp_releases)
fi
COMPREPLY=( $( compgen -W "git $RELEASES" -- "$cur") )
else
- if [ -f "$HOME/.kerl/otp_builds" ]; then
- BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2`
+ if [ -f "$HOME"/.kerl/otp_builds ]; then
+ BUILDS=$(cut -d ',' -f 2 "$HOME"/.kerl/otp_builds)
fi
COMPREPLY=( $( compgen -W "$BUILDS" -- "$cur") )
fi
;;
installation)
- if [ -f "$HOME/.kerl/otp_installations" ]; then
- PATHS=`cat "$HOME/.kerl/otp_installations" | cut -d " " -f 2`
+ if [ -f "$HOME"/.kerl/otp_installations ]; then
+ PATHS=$(cut -d ' ' -f 2 "$HOME"/.kerl/otp_installations)
fi
COMPREPLY=( $( compgen -W "$PATHS" -- "$cur") )
;;
install)
- if [ -f "$HOME/.kerl/otp_builds" ]; then
- BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2`
+ if [ -f "$HOME"/.kerl/otp_builds ]; then
+ BUILDS=$(cut -d ',' -f 2 "$HOME"/.kerl/otp_builds)
fi
COMPREPLY=( $( compgen -W "$BUILDS" -- "$cur") )
;;
deploy)
if [ "$COMP_CWORD" -eq 3 ]; then
- if [ -f "$HOME/.kerl/otp_installations" ]; then
- PATHS=`cat "$HOME/.kerl/otp_installations" | cut -d " " -f 2`
+ if [ -f "$HOME"/.kerl/otp_installations ]; then
+ PATHS=$(cut -d ' ' -f 2 "$HOME"/.kerl/otp_installations)
fi
fi
COMPREPLY=( $( compgen -W "$PATHS" -- "$cur") )
@@ -53,8 +54,8 @@ _kerl()
;;
*)
if [ "$COMP_CWORD" -eq 3 ]; then
- if [ -f "$HOME/.kerl/otp_builds" ]; then
- BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2`
+ if [ -f "$HOME"/.kerl/otp_builds ]; then
+ BUILDS=$(cut -d ',' -f 2 "$HOME"/.kerl/otp_builds)
fi
if [ -n "$BUILDS" ]; then
for b in $BUILDS; do
@@ -69,4 +70,3 @@ _kerl()
esac
}
complete -F _kerl kerl
-