{-# LANGUAGE OverloadedStrings          #-}

module HS.CLI.ToolArgs where

import           Data.Text(Text)
import           Fmt


-- | list of command line arguments to be passed through to the compiler tool
newtype ToolArgs = ToolArgs { ToolArgs -> [Text]
getToolArgs :: [Text] }
  deriving (Int -> ToolArgs -> ShowS
[ToolArgs] -> ShowS
ToolArgs -> String
(Int -> ToolArgs -> ShowS)
-> (ToolArgs -> String) -> ([ToolArgs] -> ShowS) -> Show ToolArgs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ToolArgs] -> ShowS
$cshowList :: [ToolArgs] -> ShowS
show :: ToolArgs -> String
$cshow :: ToolArgs -> String
showsPrec :: Int -> ToolArgs -> ShowS
$cshowsPrec :: Int -> ToolArgs -> ShowS
Show)

instance Buildable ToolArgs where
  build :: ToolArgs -> Builder
build (ToolArgs [Text]
as) = [Text] -> Builder
forall (f :: * -> *) a. (Foldable f, Buildable a) => f a -> Builder
unwordsF [Text]
as