parseArgs :: Parser Arguments
parseArgs
  = Arguments
      <$> ( setDefault 300 . fmap fromIntegral . option auto $
              ( short 'r'
             <> long "runRate"
             <> metavar "INT"
             <> help "Rough interval (in seconds) between runs of log-monitor (default 300s)"
              )
          )
      <*> ( setDefault 604800 . fmap fromIntegral . option auto $
              ( short 'e'
             <> long "exceptionRate"
             <> metavar "INT"
             <> help "Interval (in seconds) for which to email admins with log parsing errors (default one week)"
              )
          )
      <*> ( setDefault "log-monitor.yaml" . strOption $
              ( short 'c'
             <> long "config-file"
             <> metavar "FILE"
             <> help "Path to config file (default log-monitor.yaml)"
              )
          )
      <*> ( setDefault "log-monitor.log" . strOption $
              ( short 'l'
             <> long "log-file"
             <> metavar "FILE"
             <> help "File to store log-monitor logs (default log-monitor.log)"
              )
          )
      <*> ( switch $
              ( short 'd'
             <> long "debug"
             <> help "Log additional debugging information"
              )
          )
parseArgs :: Parser Arguments
parseArgs
  = Arguments
      <$> ( setDefault 300 . fmap fromIntegral . option auto $
              ( short 'r'
             <> long "runRate"
             <> metavar "INT"
             <> help "Rough interval (in seconds) between runs of log-monitor (default 300s)"
              )
          )
      <*> ( setDefault 604800 . fmap fromIntegral . option auto $
              ( short 'e'
             <> long "exceptionRate"
             <> metavar "INT"
             <> help "Interval (in seconds) for which to email admins with log parsing errors (default one week)"
              )
          )
      <*> ( setDefault "log-monitor.yaml" . strOption $
              ( short 'c'
             <> long "config-file"
             <> metavar "FILE"
             <> help "Path to config file (default log-monitor.yaml)"
              )
          )
      <*> ( setDefault "log-monitor.log" . strOption $
              ( short 'l'
             <> long "log-file"
             <> metavar "FILE"
             <> help "File to store log-monitor logs (default log-monitor.log)"
              )
          )
      <*> ( switch $
              ( short 'd'
             <> long "debug"
             <> help "Log additional debugging information"
              )
          )
parseArgs
  = Arguments
      <$> ( setDefault 300 . fmap fromIntegral . option auto $
              ( short 'r'
             <> long "runRate"
             <> metavar "INT"
             <> help "Rough interval (in seconds) between runs of log-monitor (default 300s)"
              )
          )
      <*> ( setDefault 604800 . fmap fromIntegral . option auto $
              ( short 'e'
             <> long "exceptionRate"
             <> metavar "INT"
             <> help "Interval (in seconds) for which to email admins with log parsing errors (default one week)"
              )
          )
      <*> ( setDefault "log-monitor.yaml" . strOption $
              ( short 'c'
             <> long "config-file"
             <> metavar "FILE"
             <> help "Path to config file (default log-monitor.yaml)"
              )
          )
      <*> ( setDefault "log-monitor.log" . strOption $
              ( short 'l'
             <> long "log-file"
             <> metavar "FILE"
             <> help "File to store log-monitor logs (default log-monitor.log)"
              )
          )
      <*> ( switch $
              ( short 'd'
             <> long "debug"
             <> help "Log additional debugging information"
              )
          )