-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the local-cluster exe code into the exe source dir
- Loading branch information
Showing
5 changed files
with
76 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/CommandLine.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DerivingStrategies #-} | ||
|
||
module Cardano.Wallet.Launch.Cluster.CommandLine | ||
( CommandLineOptions (..) | ||
, parseCommandLineOptions | ||
, clusterConfigsDirParser | ||
) where | ||
|
||
import Prelude | ||
|
||
import Cardano.Wallet.Launch.Cluster.FileOf | ||
( Absolutizer (..) | ||
, DirOf (..) | ||
, newAbsolutizer | ||
) | ||
import Options.Applicative | ||
( (<**>) | ||
) | ||
import System.Path | ||
( absRel | ||
) | ||
|
||
import qualified Options.Applicative as O | ||
|
||
newtype CommandLineOptions = CommandLineOptions | ||
{clusterConfigsDir :: DirOf "cluster-configs"} | ||
deriving stock (Show) | ||
|
||
parseCommandLineOptions :: IO CommandLineOptions | ||
parseCommandLineOptions = do | ||
absolutizer <- newAbsolutizer | ||
O.execParser | ||
$ O.info | ||
( fmap CommandLineOptions (clusterConfigsDirParser absolutizer) | ||
<**> O.helper | ||
) | ||
(O.progDesc "Local Cluster for testing") | ||
|
||
clusterConfigsDirParser :: Absolutizer -> O.Parser (DirOf "cluster-configs") | ||
clusterConfigsDirParser (Absolutizer absOf) = | ||
DirOf . absOf . absRel | ||
<$> O.strOption | ||
( O.long "cluster-configs" | ||
<> O.metavar "LOCAL_CLUSTER_CONFIGS" | ||
<> O.help "Path to the local cluster configuration directory" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters