From e45b3abab2523ad65f1a5b2ca531ceb73b91fcd3 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Tue, 2 Aug 2022 00:54:38 -0700 Subject: [PATCH] test -z --- share/completions/configure.fish | 4 ++-- share/completions/npm.fish | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/completions/configure.fish b/share/completions/configure.fish index 2ab798602..2d10e22e6 100644 --- a/share/completions/configure.fish +++ b/share/completions/configure.fish @@ -23,11 +23,11 @@ function __fish_parse_configure # Just fish's `./configure --help` takes ~350ms to run, before parsing # The following chain attempts to extract the help message: cat $argv[1] | tr \n \u0e | sed -n 's/.*Report the --help message\(.*\?\)ac_status.*/\1/; s/ac_status.*//p' | tr \u0e \n | - while test "$next_line" != "" || read -lL next_line + while test -n "$next_line" || read -lL next_line # In autoconfigure scripts, the first column wraps at 26 chars # echo next_line: $next_line # echo old_line: $line - if test "$line" = "" + if test -z "$line" set line $next_line set next_line "" # mark it as consumed continue diff --git a/share/completions/npm.fish b/share/completions/npm.fish index 4651ceba9..1aa28a61f 100644 --- a/share/completions/npm.fish +++ b/share/completions/npm.fish @@ -58,7 +58,7 @@ function __fish_complete_npm -d "Complete the commandline using npm's 'completio set -lx COMP_POINT (commandline -C) # If the cursor is after the last word, the empty token will disappear in the expansion # Readd it - if test (commandline -ct) = "" + if test -z (commandline -ct) set COMP_CWORD (math $COMP_CWORD + 1) set COMP_LINE $COMP_LINE "" end