aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-04-08 11:27:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-04-08 11:27:54 +1200
commit0e47e897bda3a0df6cd74765dc02b2d73dde5b41 (patch)
treec9055a0b18de04739e611edd3646d868ecb97e8d /bin
parentRemove unmap of Q (diff)
downloaddotfiles-0e47e897bda3a0df6cd74765dc02b2d73dde5b41.tar.gz
dotfiles-0e47e897bda3a0df6cd74765dc02b2d73dde5b41.zip
Add comments that can disable shoal parsing
Diffstat (limited to 'bin')
-rwxr-xr-xbin/shoal27
1 files changed, 24 insertions, 3 deletions
diff --git a/bin/shoal b/bin/shoal
index 9fad9454..ad08c83a 100755
--- a/bin/shoal
+++ b/bin/shoal
@@ -12,9 +12,30 @@
# Name self
self=shoal
+# Start by assuming we should parse all hosts
+declare -i shoal
+shoal=1
+
+# Iterate through the config
while read -r option value _ ; do
- if [[ $option == 'Host' && $value != *[^[:alnum:]._-]* ]] ; then
- printf '%s\n' "$value"
- fi
+
+ # "### shoal" and "### noshoal" toggles parsing
+ case $option in
+ '###')
+ case $value in
+ noshoal)
+ shoal=0
+ ;;
+ shoal)
+ shoal=1
+ ;;
+ esac
+ ;;
+ 'Host')
+ if ((shoal)) && [[ $value != *[^[:alnum:]_-]* ]] ; then
+ printf '%s\n' "$value"
+ fi
+ ;;
+ esac
done < "${1:-$HOME/.ssh/config}"