cmdargsはargsと同時にhelpを設定するとシぬ

clOptions :: CommandLineOptions
clOptions = CommandLineOptions
  { frontend    = "vty"   &= help "The frontend to use"
  , startOnLine = Nothing &= help "Open the (last) file on line NUM"
  , files       = []      &= help "FILES..." &= args  -- ここ
  }

デフォルトの引数をfilesで受けとりたくば、helpを消せ。
さもなくば我々をcmdargsがコロす。

clOptions :: CommandLineOptions
clOptions = CommandLineOptions
  { frontend    = "vty"   &= help "The frontend to use"
  , startOnLine = Nothing &= help "Open the (last) file on line NUM"
  , files       = []      &= args  -- ここ
  }

忘れるなよ。

筆者プロフィール

my-latest-logo

aiya000(あいや)

せつラボ 〜圏論の基本〜」 「せつラボ2~雲と天使と関手圏~」 「矢澤にこ先輩といっしょに代数!」を書いています!

強い静的型付けとテストを用いて、バグを防ぐのが好き。Haskell・TypeScript。