From ff2999ef2bc0b416e278f0cf8e975fd77457eaa8 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Tue, 2 Aug 2022 00:42:09 -0700 Subject: [PATCH] Three more of the same test -z thing. --- share/functions/__fish_complete_blockdevice.fish | 2 +- share/functions/cdh.fish | 2 +- share/functions/help.fish | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/functions/__fish_complete_blockdevice.fish b/share/functions/__fish_complete_blockdevice.fish index 75e62763a..ce0185e06 100644 --- a/share/functions/__fish_complete_blockdevice.fish +++ b/share/functions/__fish_complete_blockdevice.fish @@ -1,7 +1,7 @@ # Helper function for completions that need to enumerate block devices. function __fish_complete_blockdevice set -l cmd (commandline -ct) - test "" = "$cmd" + test -z "$cmd" and set cmd /dev/ for f in $cmd* test -b $f diff --git a/share/functions/cdh.fish b/share/functions/cdh.fish index 0499877a3..c738e9c96 100644 --- a/share/functions/cdh.fish +++ b/share/functions/cdh.fish @@ -64,7 +64,7 @@ function cdh --description "Menu based cd command" # Ask the user which directory from their history they want to cd to. set -l msg (_ 'Select directory by letter or number: ') read -l -p "echo '$msg'" choice - if test "$choice" = "" + if test -z "$choice" return 0 else if string match -q -r '^[a-z]$' $choice # Convert the letter to an index number. diff --git a/share/functions/help.fish b/share/functions/help.fish index 89309219a..a9c0c5049 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -48,7 +48,7 @@ function help --description 'Show help for the fish shell' # If we are in a graphical environment, check if there is a graphical # browser to use instead. - if test -n "$DISPLAY" -a \( "$XAUTHORITY" = "$HOME/.Xauthority" -o "$XAUTHORITY" = "" \) + if test -n "$DISPLAY" -a \( "$XAUTHORITY" = "$HOME/.Xauthority" -o -z "$XAUTHORITY"\) for i in $graphical_browsers if type -q -f $i set fish_browser $i