@@ -25,15 +25,14 @@ import Data.Version (showVersion)
25
25
import NeatInterpolation (text )
26
26
import Options.Applicative (Parser , auto , execParser , footerDoc ,
27
27
fullDesc , header , help , helper , info , infoOption , long ,
28
- metavar , option , progDesc , showDefault , strOption , switch ,
29
- value )
28
+ metavar , option , progDesc , strOption , switch , value )
30
29
import Text.PrettyPrint.ANSI.Leijen (Doc )
31
30
32
31
import Paths_cardano_sl (version )
33
32
34
33
import Pos.Client.CLI.Options (CommonArgs (.. ), commonArgsParser ,
35
34
optionalJSONPath , templateParser )
36
- import Pos.Core.NetworkAddress (NetworkAddress , addrParser , localhost )
35
+ import Pos.Core.NetworkAddress (NetworkAddress , addrParser )
37
36
import Pos.Infra.HealthCheck.Route53 (route53HealthCheckOption )
38
37
import Pos.Infra.InjectFail (FInjectsSpec , parseFInjectsSpec )
39
38
import Pos.Infra.Network.CLI (NetworkConfigOpts , networkConfigOption )
@@ -162,7 +161,7 @@ nodeArgsParser = NodeArgs <$> behaviorParser
162
161
metavar " FILE" <>
163
162
help " Path to the behavior config"
164
163
165
- data NodeWithApiArgs = NodeWithApiArgs CommonNodeArgs NodeArgs NodeApiArgs
164
+ data NodeWithApiArgs = NodeWithApiArgs CommonNodeArgs NodeArgs ( Maybe NodeApiArgs )
166
165
167
166
nodeWithApiArgsParser :: Parser NodeWithApiArgs
168
167
nodeWithApiArgsParser =
@@ -171,22 +170,19 @@ nodeWithApiArgsParser =
171
170
<*> nodeArgsParser
172
171
<*> nodeApiArgsParser
173
172
174
- nodeApiArgsParser :: Parser NodeApiArgs
175
- nodeApiArgsParser =
176
- NodeApiArgs
177
- <$> addressParser " node-api-address" (localhost, 8080 )
178
- <*> tlsParamsParser
179
- <*> debugModeParser
180
- <*> addressParser " node-doc-address" (localhost, 8180 )
173
+ nodeApiArgsParser :: Parser (Maybe NodeApiArgs )
174
+ nodeApiArgsParser = optional $ NodeApiArgs
175
+ <$> addressParser " node-api-address"
176
+ <*> tlsParamsParser
177
+ <*> debugModeParser
178
+ <*> addressParser " node-doc-address"
181
179
where
182
- addressParser flagName defValue =
180
+ addressParser :: String -> Parser NetworkAddress
181
+ addressParser flagName =
183
182
option (fromParsec addrParser) $
184
183
long flagName
185
184
<> metavar " IP:PORT"
186
- <> help helpMsg
187
- <> showDefault
188
- <> value defValue
189
- helpMsg = " IP and port for backend node API."
185
+ <> help " IP and port for backend node API."
190
186
debugModeParser :: Parser Bool
191
187
debugModeParser =
192
188
switch (long " wallet-debug" <>
@@ -216,23 +212,20 @@ tlsParamsParser = constructTlsParams <$> certPathParser
216
212
" tlscert"
217
213
" FILEPATH"
218
214
" Path to file with TLS certificate"
219
- <> value " scripts/tls-files/server.crt"
220
215
)
221
216
222
217
keyPathParser :: Parser FilePath
223
218
keyPathParser = strOption (templateParser
224
219
" tlskey"
225
220
" FILEPATH"
226
221
" Path to file with TLS key"
227
- <> value " scripts/tls-files/server.key"
228
222
)
229
223
230
224
caPathParser :: Parser FilePath
231
225
caPathParser = strOption (templateParser
232
226
" tlsca"
233
227
" FILEPATH"
234
228
" Path to file with TLS certificate authority"
235
- <> value " scripts/tls-files/ca.crt"
236
229
)
237
230
238
231
noClientAuthParser :: Parser Bool
0 commit comments