-- | Description of the command line options and how to merge the supplied
-- options with the default values by transforming an Options record.
options :: [OptDescr (Options -> Options)]
options =
    [ Option "h" ["help"]
        (NoArg (\opts -> opts { optHelp = True }))
        "show help message"
    , Option "p" ["puid"]
        (ReqArg (\p opts -> opts { optPuids = p : optPuids opts }) "PUID")
        "include file format with this PUID in the output"
    , Option "P" ["puids-from-file"]
        (ReqArg (\f opts -> opts { optPuidsFile = Just f }) "FILE")
        "like -p, but read list of PUIDs from file (one PUID per line)"
    , Option "l" ["list"]
        (NoArg (\opts -> opts { optList = True }))
        "return a list of PUIDs instead of XML"
    , Option "S" ["include-supertypes"]
        (NoArg (\opts -> opts { optSupertypes = True }))
        "include file formats that are supertypes of the selected formats"
    , Option "s" ["include-subtypes"]
        (NoArg (\opts -> opts { optSubtypes = True }))
        "include file formats that are subtypes of the selected formats"
    , Option "o" ["output"]
        (ReqArg (\f opts -> opts { optOutFile = Just f }) "FILE")
        "output file"
    ]
options :: [OptDescr (Options -> Options)]
options =
    [ Option "h" ["help"]
        (NoArg (\opts -> opts { optHelp = True }))
        "show help message"
    , Option "p" ["puid"]
        (ReqArg (\p opts -> opts { optPuids = p : optPuids opts }) "PUID")
        "include file format with this PUID in the output"
    , Option "P" ["puids-from-file"]
        (ReqArg (\f opts -> opts { optPuidsFile = Just f }) "FILE")
        "like -p, but read list of PUIDs from file (one PUID per line)"
    , Option "l" ["list"]
        (NoArg (\opts -> opts { optList = True }))
        "return a list of PUIDs instead of XML"
    , Option "S" ["include-supertypes"]
        (NoArg (\opts -> opts { optSupertypes = True }))
        "include file formats that are supertypes of the selected formats"
    , Option "s" ["include-subtypes"]
        (NoArg (\opts -> opts { optSubtypes = True }))
        "include file formats that are subtypes of the selected formats"
    , Option "o" ["output"]
        (ReqArg (\f opts -> opts { optOutFile = Just f }) "FILE")
        "output file"
    ]
options =
    [ Option "h" ["help"]
        (NoArg (\opts -> opts { optHelp = True }))
        "show help message"
    , Option "p" ["puid"]
        (ReqArg (\p opts -> opts { optPuids = p : optPuids opts }) "PUID")
        "include file format with this PUID in the output"
    , Option "P" ["puids-from-file"]
        (ReqArg (\f opts -> opts { optPuidsFile = Just f }) "FILE")
        "like -p, but read list of PUIDs from file (one PUID per line)"
    , Option "l" ["list"]
        (NoArg (\opts -> opts { optList = True }))
        "return a list of PUIDs instead of XML"
    , Option "S" ["include-supertypes"]
        (NoArg (\opts -> opts { optSupertypes = True }))
        "include file formats that are supertypes of the selected formats"
    , Option "s" ["include-subtypes"]
        (NoArg (\opts -> opts { optSubtypes = True }))
        "include file formats that are subtypes of the selected formats"
    , Option "o" ["output"]
        (ReqArg (\f opts -> opts { optOutFile = Just f }) "FILE")
        "output file"
    ]