aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2013-06-18 12:35:28 +0200
committerTimo Weingärtner <timo@tiwe.de>2013-06-18 12:35:28 +0200
commit3c431f0dfb0223f95bf318d4fe209a81f36e88d1 (patch)
treeba31dd0eafd2a900b01c8cb557b958cf13854749
parent453e8a66e8ed850d9a7559c8269942969bad62c9 (diff)
downloadssh-agent-filter-3c431f0dfb0223f95bf318d4fe209a81f36e88d1.tar.gz
documentation update
ssh-agent-filter.C: remove remains of initial plan to wrap ssh in the filter afssh: add --help
-rwxr-xr-xafssh23
-rw-r--r--ssh-agent-filter.C2
2 files changed, 17 insertions, 8 deletions
diff --git a/afssh b/afssh
index 97a0a25..12ad1d8 100755
--- a/afssh
+++ b/afssh
@@ -1,5 +1,7 @@
#!/bin/bash
+# afssh -- wrapper around ssh-agent-filter and ssh
+#
# Copyright (C) 2013 Timo Weingärtner <timo@tiwe.de>
#
# This file is part of ssh-agent-filter.
@@ -22,8 +24,21 @@ set -e
declare -a agent_filter_args
+if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then
+ SAF=$(readlink -f "${BASH_SOURCE%/*}/ssh-agent-filter")
+else
+ SAF=$(which ssh-agent-filter)
+fi
+
while true; do
- if [ "$1" = "--" ]; then
+ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+ echo "usage: afssh [ssh-agent-filter options] -- [ssh options]"
+ echo
+ "$SAF" --help
+ echo
+ ssh --help
+ exit
+ elif [ "$1" = "--" ]; then
shift
break
else
@@ -38,12 +53,6 @@ unset SSH_AGENT_PID
trap 'kill "$SSH_AGENT_PID"; rm -r "$TEMPDIR"' EXIT
TEMPDIR=$(mktemp -d)
-if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then
- SAF=$(readlink -f "${BASH_SOURCE%/*}/ssh-agent-filter")
-else
- SAF=$(which ssh-agent-filter)
-fi
-
eval $(cd "$TEMPDIR"; "$SAF" "${agent_filter_args[@]}" || echo exit $?)
ssh-add -l
diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C
index 0d83cef..61acafe 100644
--- a/ssh-agent-filter.C
+++ b/ssh-agent-filter.C
@@ -156,7 +156,7 @@ void parse_cmdline (int const argc, char const * const * const argv) {
po::notify(config);
if (config.count("help")) {
- std::cout << "Invocation: ssh-agent-filter [ OPTIONS ] -- [ SSH ARGUMENTS ]" << std::endl;
+ std::cout << "Invocation: ssh-agent-filter [ OPTIONS ]" << std::endl;
std::cout << opts << std::endl;
exit(EX_OK);
}