X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=docs%2FGoalfile.pod;h=85d19ba8fed6408bb1acc8eab9a4ff639bb064a6;hb=be61a8a416b1bef88a416579cc663f1849ccf1cf;hp=75ae4fce405777f85cf5ebdf0b80e53d6f02e77a;hpb=9607fb2d34d679e14040f9132625a53f1de5200a;p=goals.git diff --git a/docs/Goalfile.pod b/docs/Goalfile.pod index 75ae4fc..85d19ba 100644 --- a/docs/Goalfile.pod +++ b/docs/Goalfile.pod @@ -30,6 +30,14 @@ For example: Returns the directory part of the path. +=head3 error (msg) + +For example: + + error ("this should not happen") + +This prints the error message and causes goals to exit. + =head3 extension (filename) For example: @@ -38,6 +46,50 @@ For example: Returns the filename extension. +=head3 head (list) + +For example: + + head (["a", "b", "c"]) ⇒ "a" + +Returns the head (first) element of the list. + +=head3 join (list1, list2) + +For example: + + join (["a", "b"], ["c", "d"]) ⇒ ["a", "b", "c", "d"] + +Concatenate C and C. It's not usually necessary to use +this function since goals automatically flattens lists within lists +into simple lists in many cases. + +=head3 read (filename) + +For example: + + read ("filename") => "this is the content of filename" + +Read the contents of C and return it as a single string. +If there is a trailing C<\n> in the file it is truncated. + +=head3 readlines (filename) + +For example: + + readlines ("filename") => ["line1", "line2", "line3"] + +Read the lines in C returning a list of strings. + +=head3 realpath (filename) + +For example: + + realpath ("./tests") ⇒ "/home/user/tests" + +Run the L command to return the resolved absolute path of +the C parameter. + =head3 sort (list) For example: @@ -57,6 +109,14 @@ This function works something like make’s C function, except that C is a regular expression, specifically a L extended regular expression. +=head3 tail (list) + +For example: + + tail (["a", "b", "c"]) ⇒ ["b", "c"] + +Returns the tail (all except first) elements of the list. + =head3 wildcard (pattern) For example: