From 737cbd0d9a2b4dd857e29747619cbbfe331bb0e8 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Fri, 27 Mar 2020 20:31:49 -0500 Subject: [PATCH] fish: use fish_indent on functions --- fish/functions/battery.fish | 2 +- fish/functions/confirm.fish | 8 ++++---- fish/functions/dns_flush.fish | 8 ++++---- fish/functions/fbrew.fish | 16 ++++++++-------- fish/functions/video_compress.fish | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fish/functions/battery.fish b/fish/functions/battery.fish index f40e896..35152b5 100644 --- a/fish/functions/battery.fish +++ b/fish/functions/battery.fish @@ -7,7 +7,7 @@ function battery set --local battery_status (pmset -g batt | string split0) set --local battery_charge (echo $battery_status | rg --only-matching "\d+%") - set --local power_source (echo $battery_status | rg --only-matching "[A-Za-z]+\sPower") + set --local power_source (echo $battery_status | rg --only-matching "[A-Za-z]+\sPower") set_color green echo "⚡️ Running on $power_source with $battery_charge charge" diff --git a/fish/functions/confirm.fish b/fish/functions/confirm.fish index 1d8016b..8783a5a 100644 --- a/fish/functions/confirm.fish +++ b/fish/functions/confirm.fish @@ -3,10 +3,10 @@ function confirm --description "Ask for user confirmation" read --local --prompt-str='Are you sure you want to continue? [y/N] ' confirmed switch $confirmed - case Y y - return 0 - case '' N n - return 1 + case Y y + return 0 + case '' N n + return 1 end end end diff --git a/fish/functions/dns_flush.fish b/fish/functions/dns_flush.fish index 94247e2..4dfe0f2 100644 --- a/fish/functions/dns_flush.fish +++ b/fish/functions/dns_flush.fish @@ -1,8 +1,8 @@ function dns_flush switch (uname -s) - case Darwin - sudo killall -HUP mDNSResponder - case '*' - echo "Unsupported kernel: "(uname -s) + case Darwin + sudo killall -HUP mDNSResponder + case '*' + echo "Unsupported kernel: "(uname -s) end end diff --git a/fish/functions/fbrew.fish b/fish/functions/fbrew.fish index c3b4886..b81a204 100644 --- a/fish/functions/fbrew.fish +++ b/fish/functions/fbrew.fish @@ -5,12 +5,12 @@ function fbrew --description "Fuzzy homebrew" end switch $argv[1] - case i install - _fbrew_install $argv[2..-1] - case u uninstall - _fbrew_uninstall $argv[2..-1] - case '*' - echo "Unsupported command: $argv[1]" + case i install + _fbrew_install $argv[2..-1] + case u uninstall + _fbrew_uninstall $argv[2..-1] + case '*' + echo "Unsupported command: $argv[1]" end end @@ -47,7 +47,7 @@ function _fbrew_uninstall set --local uninst_pkgs_all $uninst_pkgs set --local locked_pkgs_all $locked_pkgs for bdi in $brew_deps_installed - set --local pkg (string split ':' $bdi | head -n 1) + set --local pkg (string split ':' $bdi | head -n 1) set --local deps (string split ' ' (string split ':' $bdi | tail -n +2)) if contains -- $pkg $uninst_pkgs for dep in $deps @@ -72,7 +72,7 @@ function _fbrew_uninstall # Don't uninstall dependencies of other installed packages set --local uninst_pkgs_final $uninst_pkgs_all for bdi in $brew_deps_installed - set --local pkg (string split ':' $bdi | head -n 1) + set --local pkg (string split ':' $bdi | head -n 1) set --local deps (string split ' ' (string split ':' $bdi | tail -n +2)) if not contains -- $pkg $uninst_pkgs_all for dep in $deps diff --git a/fish/functions/video_compress.fish b/fish/functions/video_compress.fish index e98f4fe..c8b10ba 100644 --- a/fish/functions/video_compress.fish +++ b/fish/functions/video_compress.fish @@ -14,7 +14,7 @@ function video_compress --argument-names srcfile # Output: srcfile.extension -> srcfile-compressed.mp4 set --local dstfile (string split -r -m1 . $srcfile)[1]-compressed.mp4 - set --local preset 'Vimeo YouTube HQ 720p60' + set --local preset 'Vimeo YouTube HQ 720p60' HandBrakeCLI --preset $preset --input $srcfile --output $dstfile end