1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-07 03:59:25 +00:00

utility: Add support for 'aria2c' in 'get' alias

`get` alias now supports `aria2c` via optional `zstyle`.

To configure `aria2c` to be used for `get`, use:
zstyle -s ':prezto:module:utility:download' helper 'aria2c'

Note that we still fall back to `curl` when the desired download helper
isn't available.
This commit is contained in:
Indrajit Raychaudhuri
2021-05-12 00:48:41 -05:00
committed by Indrajit Raychaudhuri
parent 7980dd91c9
commit 515d70f639
2 changed files with 26 additions and 6 deletions

View File

@ -163,12 +163,22 @@ alias pbc='pbcopy'
alias pbp='pbpaste'
# File Download
if (( $+commands[curl] )); then
alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time'
elif (( $+commands[wget] )); then
alias get='wget --continue --progress=bar --timestamping'
zstyle -s ':prezto:module:utility:download' helper '_download_helper' || _download_helper='curl'
typeset -A _download_helpers=(
aria2c 'aria2c --continue --remote-time --max-tries=0'
curl 'curl --continue-at - --location --progress-bar --remote-name --remote-time'
wget 'wget --continue --progress=bar --timestamping'
)
if (( $+commands[$_download_helper] && $+_download_helpers[$_download_helper] )); then
alias get="$_download_helpers[$_download_helper]"
elif (( $+commands[curl] )); then
alias get="$_download_helpers[curl]"
fi
unset _download_helper{,s}
# Resource Usage
alias df='df -kh'
alias du='du -kh'