aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-04-25 01:33:17 +1000
committerGravatar axel <axel@liljencrantz.se>2007-04-25 01:33:17 +1000
commit52e7a7ec1c47f5cb826e50c54f4dc13733157375 (patch)
treeb50e29c8e5613a1b4e9ac2aa8591d451da29f052 /share
parentc00e1fcf269ac5e155cc23bd00855a7cfdaf24f3 (diff)
Actually add the count function. Thanks to Tassilo Horn for the report.
darcs-hash:20070424153317-ac50b-f6ab71ad0ea9d74351169d18f1dc856a442ee3f4.gz
Diffstat (limited to 'share')
-rw-r--r--share/functions/count.fish11
1 files changed, 11 insertions, 0 deletions
diff --git a/share/functions/count.fish b/share/functions/count.fish
new file mode 100644
index 00000000..1ddb30b5
--- /dev/null
+++ b/share/functions/count.fish
@@ -0,0 +1,11 @@
+
+function count --description "Count the number of elements of an array"
+ set -l lines ''
+ set result 1
+ for i in $argv
+ set lines $lines\n
+ set result 0
+ end
+ echo -n $lines|wc -l
+ return $result
+end