Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:sm/sm_apidoc

  • Loading branch information...
commit 1f33d2e458caa094be1927af65f27b2a4de6e21e 2 parents 151687c + 52e5bf1
@wayneeseguin wayneeseguin authored
Showing with 27 additions and 13 deletions.
  1. +27 −13 man/man1/apidoc_array.1
View
40 man/man1/apidoc_array.1
@@ -18,8 +18,19 @@ Adds the content of the origin array to the destination array
.B each
loops over each element in a given array
.TP 13
-.B first?
-prints out the first elements to standard output
+.B first {array}
+prints out the first element of a given array
+.TP 13
+.B first {array} index
+Prints the index of the first element of a given array. This allows you to get around shells indexing differently
+ Example:
+ a=(one two three)
+ a[0] # one in bash, nothing in zsh
+ a[1] # two in bash, one in zsh
+ a[$(array start)] # one
+.TP 13
+.B first {array} as [myvar]
+saves the first element of a given array in the variable myvar
.TP 13
.B is empty
tests if a given array is empty
@@ -36,8 +47,19 @@ tests if the given array is nonempty
.B largest {array}
prints the largest (character count) element in a given array
.TP 13
-.B last
+.B last {array}
prints the last element a given array
+.TP 13
+.B last {array} index
+Prints the index of the last element of a given array. This allows you to get around shells indexing differently
+ Example:
+ a=(one two three)
+ a[0] # one in bash, nothing in zsh
+ a[1] # two in bash, one in zsh
+ a[$(array start)] # one
+.TP 13
+.B last {array} as [myvar]
+saves the last element of a given array on the variable myvar
.TP 13
.B length
prints the element count of a given array
@@ -57,18 +79,10 @@ Sort array elements in ascending order
.B sort desc
Sort array elements in descending order
.TP 13
-B. start
-Prints out the index of the first element of a given array. This allows you to get around shells indexing differently
- Example:
- a=(one two three)
- a[0] # one in bash, nothing in zsh
- a[1] # two in bash, one in zsh
- a[$(array start)] # one
-.TP 13
-B. unique
+.B unique
Filters out all duplicated elements from a given array
.TP 13
-B. unshift {origin} {item}
+.B unshift {origin} {item}
Appends an item to the beginning of a given array
Please sign in to comment.
Something went wrong with that request. Please try again.