From 560985cdeefd6a25df8e6cda821805cae51a3bdf Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 17 May 2018 13:24:26 +0200 Subject: [PATCH] Remove `test` invocations with implicit `-n` tests This is something we would like to remove - #2037. --- share/completions/p4.fish | 4 ++-- share/functions/vared.fish | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/completions/p4.fish b/share/completions/p4.fish index 08ac3b450..6e2250122 100644 --- a/share/completions/p4.fish +++ b/share/completions/p4.fish @@ -242,10 +242,10 @@ function __fish_print_p4_parallel_options -d "Values for --parallel option in va # for now only looks that mode is set, later it will need to have a specific setting echo 'threads='\t"sends files concurrently using N independent network connections" echo 'batch='\t"specifies the number of files in a batch" - test "$mode" + test -n "$mode" or echo 'batchsize='\t"specifies the number of bytes in a batch" echo 'min='\t"specifies the minimum number of files in a parallel sync" - test "$mode" + test -n "$mode" or echo 'minsize='\t"specifies the minimum number of bytes in a parallel sync" end diff --git a/share/functions/vared.fish b/share/functions/vared.fish index f14794df7..2104757ac 100644 --- a/share/functions/vared.fish +++ b/share/functions/vared.fish @@ -18,7 +18,7 @@ function vared --description "Edit variable value" case '*' if test (count $$argv ) -lt 2 set -l init '' - if test $$argv + if test -n "$$argv" set init $$argv end set -l prompt 'set_color green; echo '$argv'; set_color normal; echo "> "' @@ -30,7 +30,7 @@ function vared --description "Edit variable value" # global, so that it will not die when this # function dies - if test $$argv + if test -n "$$argv" set $argv $tmp else set -g $argv $tmp