2

I got an argument parser working using getOpt which is great, but I do have one question. When using ReqArg in an option like:

Option ['c'] ["config"] (ReqArg (\f opts -> opts { configFile = f }) "FILE")
                     "use a custom configuration file"

what does it use that second argument for (in this case, "FILE")? I have not experienced any kind of difference in behavior when specifying another string.

4

1 回答 1

6

它用于自动生成的使用消息。与 OptArg 相同。在您的 OptDescr 列表上运行usageInfo,看看会返回什么。

于 2013-02-11T18:15:14.813 回答