diff options
| -rwxr-xr-x | afssh | 23 | ||||
| -rw-r--r-- | ssh-agent-filter.C | 2 | 
2 files changed, 17 insertions, 8 deletions
| @@ -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);  	} | 
