mirror of
https://github.com/simplex-chat/haskell.nix.git
synced 2026-06-03 09:17:32 +00:00
5b7f7f245c
git-subtree-dir: nix-tools git-subtree-mainline:1110a74a9dgit-subtree-split:555d57e1ea
28 lines
833 B
Haskell
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" )
|