From e46978fedb97523270a5c6563f1da7464a417922 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 7 Aug 2016 19:29:14 -0700 Subject: [PATCH] simplify previous change to the _ script There's no need for a local var or echo in a subcommand. Also, fix the formatting to match the style guide. --- share/functions/_.fish | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/share/functions/_.fish b/share/functions/_.fish index 4ab93ce69..27b03db90 100644 --- a/share/functions/_.fish +++ b/share/functions/_.fish @@ -1,14 +1,13 @@ # -# Alias for gettext (or a fallback if gettext isn't installed) +# Alias for gettext or a fallback if gettext isn't installed. # -set -l gettext_path (command -v gettext) -if test -x (echo $gettext_path) - function _ --description "Alias for the gettext command" - command gettext fish $argv - end +if command -s gettext >/dev/null + function _ --description "Alias for the gettext command" + command gettext fish $argv + end else - function _ --description "Fallback alias for the gettext command" - echo -n $argv - end + function _ --description "Fallback alias for the gettext command" + echo -n $argv + end end