From c817bfccfbe0141df4c9d8462955581c177298f1 Mon Sep 17 00:00:00 2001
From: Justin Hileman <justin@justinhileman.info>
Date: Mon, 9 Feb 2015 11:34:48 -0800
Subject: [PATCH] Fix "missing argument" error when calling tab without args

---
 plugins/tab/tab.fish | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/plugins/tab/tab.fish b/plugins/tab/tab.fish
index b01c5b9..fa6248a 100644
--- a/plugins/tab/tab.fish
+++ b/plugins/tab/tab.fish
@@ -12,12 +12,14 @@ function tab -d 'Open the current directory (or any other directory) in a new ta
   set -l cmd ''
   set -l cdto $PWD
 
-  if test (count $argv) -gt 0 -a -d $argv[1]
-    pushd . >/dev/null
-    cd $argv[1]
-    set cdto $PWD
-    set -e argv[1]
-    popd >/dev/null
+  if test (count $argv) -gt 0
+    if test -d $argv[1]
+      pushd . >/dev/null
+      cd $argv[1]
+      set cdto $PWD
+      set -e argv[1]
+      popd >/dev/null
+    end
   end
 
   if test (count $argv) -gt 0
-- 
GitLab