@@ -11,12 +11,8 @@ import Cardano.Shell.Features.Logging (LoggingCLIArguments,
11
11
import Cardano.Shell.Features.Networking (createNetworkingFeature )
12
12
13
13
import Cardano.Shell.Configuration.Lib (finaliseCardanoConfiguration )
14
- import Cardano.Shell.Constants.CLI (configBlockCLIParser ,
15
- configCoreCLIParser ,
16
- configWalletCLIParser )
17
- import Cardano.Shell.Constants.PartialTypes (PartialBlock (.. ), PartialCardanoConfiguration (.. ),
18
- PartialCore (.. ),
19
- PartialWallet (.. ))
14
+ import Cardano.Shell.Constants.CLI (configCardanoConfigurationCLIParser )
15
+ import Cardano.Shell.Constants.PartialTypes (PartialCardanoConfiguration (.. ))
20
16
import Cardano.Shell.Lib
21
17
import Cardano.Shell.Presets (mainnetConfiguration )
22
18
import Cardano.Shell.Types
@@ -26,11 +22,7 @@ import Options.Applicative
26
22
27
23
-- | The product type of all command line arguments.
28
24
-- All here being - from all the features.
29
- data CLIArguments = CLIArguments
30
- ! LoggingCLIArguments
31
- ! PartialWallet
32
- ! PartialBlock
33
- ! PartialCore
25
+ data CLIArguments = CLIArguments ! LoggingCLIArguments ! PartialCardanoConfiguration
34
26
35
27
main :: IO ()
36
28
main = do
@@ -94,49 +86,23 @@ initializeAllFeatures :: PartialCardanoConfiguration -> CardanoEnvironment -> IO
94
86
initializeAllFeatures partialConfig cardanoEnvironment = do
95
87
96
88
-- Here we parse the __CLI__ arguments for the actual application.
97
- CLIArguments loggingCLIArguments walletCLI blockCLI coreCLI <- execParser parserWithInfo
89
+ CLIArguments loggingCLIArguments cardanoConfigurationCLI <- execParser parserWithInfo
98
90
99
- let configCore = pccCore partialConfig
100
- let configBlock = pccBlock partialConfig
101
- let configWallet = pccWallet partialConfig
102
-
103
- let pccCore' = configCore <> coreCLI
104
- let pccBlock' = configBlock <> blockCLI
105
- let pccWallet' = configWallet <> walletCLI
106
-
107
- putTextLn " ************************************************"
108
- putTextLn " CORE"
109
- putTextLn " ************************************************"
110
- putTextLn $ show configCore
111
- putTextLn " ------------------------------------------------"
112
- putTextLn $ show coreCLI
113
- putTextLn " ------------------------------------------------"
114
- putTextLn $ show pccCore'
91
+ let cardanoConfiguration' = partialConfig <> cardanoConfigurationCLI
115
92
116
93
putTextLn " ************************************************"
117
- putTextLn " BLOCK "
94
+ putTextLn " Cardano configurationn "
118
95
putTextLn " ************************************************"
119
- putTextLn $ show configBlock
120
- putTextLn " ------------------------------------------------"
121
- putTextLn $ show blockCLI
96
+ putTextLn $ show partialConfig
122
97
putTextLn " ------------------------------------------------"
123
- putTextLn $ show pccBlock'
124
-
125
- putTextLn " ************************************************"
126
- putTextLn " WALLET"
127
- putTextLn " ************************************************"
128
- putTextLn $ show configWallet
98
+ putTextLn $ show cardanoConfigurationCLI
129
99
putTextLn " ------------------------------------------------"
130
- putTextLn $ show walletCLI
100
+ putTextLn $ show cardanoConfiguration'
131
101
putTextLn " ------------------------------------------------"
132
- putTextLn $ show pccWallet'
133
102
103
+ -- Finalize the configuration and if something is missing, just throw error.
134
104
finalConfig <- either (throwIO . ConfigurationError ) pure $
135
- finaliseCardanoConfiguration $ partialConfig
136
- { pccCore = pccCore'
137
- , pccBlock = pccBlock'
138
- , pccWallet = pccWallet'
139
- }
105
+ finaliseCardanoConfiguration cardanoConfiguration'
140
106
141
107
-- Here we initialize all the features
142
108
(loggingLayer, loggingFeature) <- createLoggingFeature cardanoEnvironment finalConfig loggingCLIArguments
@@ -164,7 +130,5 @@ initializeAllFeatures partialConfig cardanoEnvironment = do
164
130
commandLineParser :: Parser CLIArguments
165
131
commandLineParser = CLIArguments
166
132
<$> loggingParser
167
- <*> configWalletCLIParser
168
- <*> configBlockCLIParser
169
- <*> configCoreCLIParser
133
+ <*> configCardanoConfigurationCLIParser
170
134
0 commit comments