From 556d5d241f80301cd4f0be5cdbe35fd19571689d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 25 Feb 2021 19:36:14 -0600 Subject: Run shfmt on the buffer --- bollux | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/bollux b/bollux index 51ca597..dcf81ae 100755 --- a/bollux +++ b/bollux @@ -129,8 +129,8 @@ bollux_config() { : "${BOLLUX_PAGESRC:=$BOLLUX_DATADIR/pagesrc}" # where to save the source BOLLUX_HISTFILE="$BOLLUX_DATADIR/history" # where to save the history ## typesetting - : "${T_MARGIN:=4}" # left and right margin - : "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width + : "${T_MARGIN:=4}" # left and right margin + : "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width # colors -- these will be wrapped in \e[ __ m C_RESET='\e[0m' # reset : "${C_SIGIL:=35}" # sigil (=>, #, ##, ###, *, ```) @@ -209,7 +209,7 @@ blastoff() { # blastoff [-u] URL ## https://tools.ietf.org/html/rfc3986 uwellform() { local u="$1" - + if [[ "$u" != *://* ]]; then u="$BOLLUX_PROTO://$u" fi @@ -237,7 +237,7 @@ usplit() { # usplit NAME:ARRAY URL:STRING else printf -v "$1[$i]" "$UC_BLANK" fi - ((i+=1)) + ((i += 1)) done printf -v "$1[0]" "$(ujoin "$1")" # inefficient I'm sure } @@ -254,7 +254,7 @@ ujoin() { # ujoin NAME:ARRAY fi printf -v U[0] "${U[0]}%s" "${U[3]}" - + if ucdef U[4]; then printf -v U[0] "${U[0]}?%s" "${U[4]}" fi @@ -268,19 +268,19 @@ ujoin() { # ujoin NAME:ARRAY ucdef() { [[ "${!1}" != "$UC_BLANK" ]]; } # ucdef NAME ucblank() { [[ -z "${!1}" ]]; } # ucblank NAME -ucset() { # ucset NAME VALUE +ucset() { # ucset NAME VALUE run eval "${1}='$2'" - run ujoin "${1/\[*\]}" + run ujoin "${1/\[*\]/}" } -utransform() { # utransform TARGET:ARRAY BASE:STRING REFERENCE:STRING - local -a B R # base, reference +utransform() { # utransform TARGET:ARRAY BASE:STRING REFERENCE:STRING + local -a B R # base, reference local -n T="$1" # target usplit B "$2" usplit R "$3" # initialize T - for ((i=1;i<=5;i++)); do + for ((i = 1; i <= 5; i++)); do T[$i]="$UC_BLANK" done @@ -396,7 +396,7 @@ uencode() { # uencode URL:STRING } # https://github.com/dylanaraps/pure-bash-bible/ -udecode() { # udecode URL:STRING +udecode() { # udecode URL:STRING : "${1//+/ }" printf '%b\n' "${_//%/\\x}" } @@ -419,10 +419,10 @@ gemini_request() { # gemini_request URL fi local ssl_cmd=( - openssl s_client - -crlf -quiet -connect "${url[2]}:$port" - -servername "${url[2]}" # SNI - -no_ssl3 -no_tls1 -no_tls1_1 # disable old TLS/SSL versions + openssl s_client + -crlf -quiet -connect "${url[2]}:$port" + -servername "${url[2]}" # SNI + -no_ssl3 -no_tls1 -no_tls1_1 # disable old TLS/SSL versions ) run "${ssl_cmd[@]}" <<<"$url" @@ -671,9 +671,9 @@ display() { # display METADATA [TITLE] local helpline="o:open, g/G:goto, [:back, ]:forward, r:refresh" less_cmd+=( -Pm"$(less_prompt_escape "$BOLLUX_URL") - bollux$" # 'status'line - -P="$(less_prompt_escape "$helpline")$" # helpline - -m # start with statusline - +k # float content to the top + -P="$(less_prompt_escape "$helpline")$" # helpline + -m # start with statusline + +k # float content to the top ) local typeset -- cgit 1.4.1-21-gabe81