bash-it/aliases/available/curl.aliases.bash

34 lines
1000 B
Bash

# shellcheck shell=bash
about-alias 'Curl aliases for convenience.'
# set apt aliases
function _set_pkg_aliases()
{
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
if _command_exists curl
then
# follow redirects
alias cl='curl -L'
# follow redirects, download as original name
alias clo='curl -L -O'
# follow redirects, download as original name, continue
alias cloc='curl -L -C - -O'
# follow redirects, download as original name, continue, retry 5 times
alias clocr='curl -L -C - -O --retry 5'
# follow redirects, fetch banner
alias clb='curl -L -I'
# see only response headers from a get request
alias clhead='curl -D - -so /dev/null'
fi
############### Stack_TRACE_BUILDER ################
Function_PATH=$( dirname "${Function_PATH}" )
####################################################
}
_set_pkg_aliases