Fixed calls to _known_hosts_real
Made _known_hosts_real raise error if there are unprocessed arguments.
This commit is contained in:
parent
cdf0e82686
commit
127eaafb54
@ -1084,6 +1084,8 @@ _known_hosts_real()
|
|||||||
p) prefix=$OPTARG ;;
|
p) prefix=$OPTARG ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
[ $# -ge $OPTIND ] && echo "error: $FUNCNAME("$@"): unprocessed arguments:"\
|
||||||
|
$(while [ $# -gt 0 ]; do echo ${!OPTIND}; shift; done)
|
||||||
|
|
||||||
[[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@}
|
[[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@}
|
||||||
kh=()
|
kh=()
|
||||||
|
@ -94,7 +94,7 @@ _ssh()
|
|||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
_known_hosts_real -a "$optconfigfile" -h "$cur"
|
_known_hosts_real -a -h "$cur" $optconfigfile
|
||||||
if [ $COMP_CWORD -ne 1 ]; then
|
if [ $COMP_CWORD -ne 1 ]; then
|
||||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- $cur ) )
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- $cur ) )
|
||||||
fi
|
fi
|
||||||
@ -144,7 +144,7 @@ _sftp()
|
|||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
_known_hosts_real -a "$optconfigfile" -h "$cur"
|
_known_hosts_real -a -h "$cur" $optconfigfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@ -200,7 +200,7 @@ _scp()
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ "$cur" == */* ]] || _known_hosts_real -c -a "$optconfigfile" -h "$cur"
|
[[ "$cur" == */* ]] || _known_hosts_real -c -a -h "$cur" $optconfigfile
|
||||||
|
|
||||||
# This approach is used instead of _filedir to get a space appended
|
# This approach is used instead of _filedir to get a space appended
|
||||||
# after local file/dir completions, and $nospace retained for others.
|
# after local file/dir completions, and $nospace retained for others.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user