options :: [OptDescr (Config -> Maybe Config) ]
options = [
      Option "q" ["quiet"] (NoArg opt_quiet)
        "disable verbose output"
    , Option "r" ["root"] (ReqArg opt_root "DIR")
        "set root directory"
    , Option "C" ["clean"] (NoArg opt_clean)
        "clean duplicate files after processing"
    , Option "n" ["dry-run"] (NoArg opt_dryRun)
        "no execute of file output"
    , Option "h" ["help"] (NoArg opt_usage)
        "print this help"
    ]
  where
    opt_quiet cfg = return cfg { cfgVerbose = False }
    opt_root arg cfg = return cfg { cfgRoot = arg }
    opt_clean cfg = return cfg { cfgClean = True }
    opt_dryRun cfg = return cfg { cfgRunIO = False }
    opt_usage _ = Nothing
options :: [OptDescr (Config -> Maybe Config) ]
options = [
      Option "q" ["quiet"] (NoArg opt_quiet)
        "disable verbose output"
    , Option "r" ["root"] (ReqArg opt_root "DIR")
        "set root directory"
    , Option "C" ["clean"] (NoArg opt_clean)
        "clean duplicate files after processing"
    , Option "n" ["dry-run"] (NoArg opt_dryRun)
        "no execute of file output"
    , Option "h" ["help"] (NoArg opt_usage)
        "print this help"
    ]
  where
    opt_quiet cfg = return cfg { cfgVerbose = False }
    opt_root arg cfg = return cfg { cfgRoot = arg }
    opt_clean cfg = return cfg { cfgClean = True }
    opt_dryRun cfg = return cfg { cfgRunIO = False }
    opt_usage _ = Nothing
options = [
      Option "q" ["quiet"] (NoArg opt_quiet)
        "disable verbose output"
    , Option "r" ["root"] (ReqArg opt_root "DIR")
        "set root directory"
    , Option "C" ["clean"] (NoArg opt_clean)
        "clean duplicate files after processing"
    , Option "n" ["dry-run"] (NoArg opt_dryRun)
        "no execute of file output"
    , Option "h" ["help"] (NoArg opt_usage)
        "print this help"
    ]
  where
    opt_quiet cfg = return cfg { cfgVerbose = False }
    opt_root arg cfg = return cfg { cfgRoot = arg }
    opt_clean cfg = return cfg { cfgClean = True }
    opt_dryRun cfg = return cfg { cfgRunIO = False }
    opt_usage _ = Nothing