1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-12-02 07:50:04 +03:00

Use in-base ftp(1) on OpenBSD instead of cURL.

This commit is contained in:
Vadim Zhukov 2018-08-16 13:34:39 +03:00
parent 0f3a1e0057
commit 4dcc3606a8

View File

@ -39,6 +39,22 @@ if echo $KSH_VERSION | grep -q ' 93' && ! local foo 2>/dev/null; then
alias local=typeset
fi
# any better test not involving either OS matching or actual query?
if [ `uname -s` = OpenBSD ] && [ -x /usr/bin/ftp ]; then
curl() {
local opt args="-U curl/7.61.0 -o -"
while getopts "b:s" opt; do
case $opt in
b) args="$args -c $OPTARG";;
s) args="$args -M -V";;
*) echo "internal error: unsupported cURL option '$opt'" >&2; exit 1;;
esac
done
shift $(($OPTIND - 1))
/usr/bin/ftp $args "$@"
}
fi
get_query_options()
{
local query="$*"