to parse the command line arguments to fit the type signature you give. For example (a :: Int, b :: String, c :: Float) <- readArgs would parse the first runtime argument as an Int, the second as a String (no quotes required) and the third as a Float. If the runtime arguments are incompatible with the type signature, then a simple usage statement is given of the types needed. Continuing the previous example, if it was used in a program named Example, the error message for the above action would be: usage: Example Int String Float Any type that has both Typeable and Read instances can be used. Char, String, and Text are handled specially so that command line arguments for both do not require quotes (as their Read instances do). A special instance is provided for FilePath so that no constructor or quotes are required.
13 lines
344 B
Makefile
13 lines
344 B
Makefile
# $NetBSD: buildlink3.mk,v 1.1 2013/08/17 09:03:37 szptvlfn Exp $
|
|
|
|
BUILDLINK_TREE+= hs-ReadArgs
|
|
|
|
.if !defined(HS_READARGS_BUILDLINK3_MK)
|
|
HS_READARGS_BUILDLINK3_MK:=
|
|
|
|
BUILDLINK_API_DEPENDS.hs-ReadArgs+= hs-ReadArgs>=1.2.1
|
|
BUILDLINK_PKGSRCDIR.hs-ReadArgs?= ../../wip/hs-ReadArgs
|
|
|
|
.endif # HS_READARGS_BUILDLINK3_MK
|
|
|
|
BUILDLINK_TREE+= -hs-ReadArgs
|