Files
Andrea Bedini 5b7f7f245c Add 'nix-tools/' from commit '555d57e1ea81b79945f2608aa261df20f6b602a5'
git-subtree-dir: nix-tools
git-subtree-mainline: 1110a74a9d
git-subtree-split: 555d57e1ea
2022-09-15 08:11:42 +02:00

28 lines
833 B
Haskell

module StackRepos.CLI
( Args(..)
, HpackUse(..)
, parseStackReposArgs
) where
import Options.Applicative hiding (option)
import Data.Semigroup ((<>))
import Stack2nix.CLI (HpackUse(..))
--------------------------------------------------------------------------------
-- CLI Arguments
newtype Args = Args
{ argStackYaml :: FilePath
} deriving Show
-- Argument Parser
args :: Parser Args
args = Args
<$> strOption ( long "stack-yaml" <> value "stack.yaml" <> showDefault <> metavar "FILE" <> help "Override project stack.yaml" )
parseStackReposArgs :: IO Args
parseStackReposArgs = execParser opts
where opts = info (args <**> helper)
( fullDesc
<> progDesc "Collect information about remote source packages used by Stack"
<> header "stack-repos - extract the details of remote repos" )