aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_is_token_n.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-02-03 23:23:59 +0100
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-02-03 23:23:59 +0100
commit158ea98189f6c5c410ea8b58f466a5ef6a8f1a33 (patch)
tree706beb417907de7154c2d6783aaed3519c6d10a0 /share/functions/__fish_is_token_n.fish
parent962f9914c61f6ab0e744009cafa56d072bbfc8a6 (diff)
Replace uses of expr with math/string
Diffstat (limited to 'share/functions/__fish_is_token_n.fish')
-rw-r--r--share/functions/__fish_is_token_n.fish11
1 files changed, 3 insertions, 8 deletions
diff --git a/share/functions/__fish_is_token_n.fish b/share/functions/__fish_is_token_n.fish
index d2129e26..c6069bde 100644
--- a/share/functions/__fish_is_token_n.fish
+++ b/share/functions/__fish_is_token_n.fish
@@ -1,10 +1,5 @@
function __fish_is_token_n --description 'Test if current token is on Nth place' --argument n
- set -l num (count (commandline -poc))
- #if test $cur
- expr $n = $num + 1 > /dev/null
- #else
- #expr $n '=' $num + 1 > /dev/null
- #end
-
-
+ # Add a fake element to increment without calling math
+ set -l num (count (commandline -poc) additionalelement)
+ test $n -eq $num
end