aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2013-06-20 15:51:30 +0200
committerTimo Weingärtner <timo@tiwe.de>2013-06-20 15:51:30 +0200
commit07557734129cd53acb5eff9d59b0d6144925e3e7 (patch)
tree7ad4776244e099c5607183f56904914884f00054
parent3c431f0dfb0223f95bf318d4fe209a81f36e88d1 (diff)
downloadssh-agent-filter-07557734129cd53acb5eff9d59b0d6144925e3e7.tar.gz
afssh: factor out usage
-rwxr-xr-xafssh16
1 files changed, 10 insertions, 6 deletions
diff --git a/afssh b/afssh
index 12ad1d8..84b8545 100755
--- a/afssh
+++ b/afssh
@@ -22,6 +22,15 @@
set -e
+usage () {
+ echo "usage: afssh [ssh-agent-filter options] -- [ssh options]"
+ echo
+ "$SAF" --help
+ echo
+ ssh --help
+ exit
+}
+
declare -a agent_filter_args
if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then
@@ -32,12 +41,7 @@ fi
while true; do
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
- echo "usage: afssh [ssh-agent-filter options] -- [ssh options]"
- echo
- "$SAF" --help
- echo
- ssh --help
- exit
+ usage
elif [ "$1" = "--" ]; then
shift
break