<commit_before>module Iptf.Options where

import Control.Applicative
import Iptf.Hosts (Hostname(..))
import Options.Applicative (
    Parser
  , ParserInfo
  , execParser
  , short
  , long
  , help
  , helper
  , progDesc
  , (<>)
  , info
  , strOption
  )
import qualified Data.Text as T

data Options = Options { path :: String
                       , hostname :: Hostname
                       , url :: String
                       } deriving (Show)

parseOptions :: Parser Options
parseOptions = Options <$> parsePath <*> parseHostname <*> parseUrl

parsePath :: Parser String
parsePath = strOption $
            short 'f' <>
            long "filepath" <>
            help "Filepath to save your IP to"

parseHostname :: Parser Hostname
parseHostname = fmap (Hostname . T.pack) $ strOption $
                short 'h' <>
                long "hostname" <>
                help "Hostname to use"

parseUrl :: Parser String<commit_msg>Rename hostname parameter<commit_after>module Iptf.Options where

import Control.Applicative
import Iptf.Hosts (Hostname(..))
import Options.Applicative (
    Parser
  , ParserInfo
  , execParser
  , short
  , long
  , help
  , helper
  , progDesc
  , (<>)
  , info
  , strOption
  )
import qualified Data.Text as T

data Options = Options { path :: String
                       , hostname :: Hostname
                       , url :: String
                       } deriving (Show)

parseOptions :: Parser Options
parseOptions = Options <$> parsePath <*> parseHostname <*> parseUrl

parsePath :: Parser String
parsePath = strOption $
            short 'f' <>
            long "filepath" <>
            help "Filepath to save your IP to"

parseHostname :: Parser Hostname
parseHostname = fmap (Hostname . T.pack) $ strOption $
                short 'n' <>
                long "name" <>
                help "Hostname to use"

parseUrl :: Parser String
{'fraction_non_alphanumeric': 0.0949367088607595, 'fraction_numerical': 0.0, 'mean_word_length': 2.0352, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191504', 'n_tokens_mistral': 563, 'n_tokens_neox': 535, 'n_words': 159}