From 3c431f0dfb0223f95bf318d4fe209a81f36e88d1 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Tue, 18 Jun 2013 12:35:28 +0200 Subject: documentation update ssh-agent-filter.C: remove remains of initial plan to wrap ssh in the filter afssh: add --help --- afssh | 23 ++++++++++++++++------- ssh-agent-filter.C | 2 +- 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 # # 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); } -- cgit v1.2.3