aboutsummaryrefslogtreecommitdiff
path: root/tprint/src/Options.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tprint/src/Options.hs')
-rw-r--r--tprint/src/Options.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tprint/src/Options.hs b/tprint/src/Options.hs
index 1ad6c47..e146f91 100644
--- a/tprint/src/Options.hs
+++ b/tprint/src/Options.hs
@@ -26,6 +26,8 @@ import Instances ()
26import Paths_tprint (version) 26import Paths_tprint (version)
27import Data.Version (showVersion) 27import Data.Version (showVersion)
28 28
29import Data.Bifunctor (Bifunctor(..))
30
29data TPrint = TPrint 31data TPrint = TPrint
30 { baseUrl :: BaseUrl 32 { baseUrl :: BaseUrl
31 , dryRun :: Bool 33 , dryRun :: Bool
@@ -148,7 +150,7 @@ pOperation = hsubparser $ mconcat [ command "printers" cmdPrinters
148 ] 150 ]
149 151
150pTPrint :: Parser TPrint 152pTPrint :: Parser TPrint
151pTPrint = TPrint <$> option (eitherReader parseBaseUrl) (metavar "URL" <> long "baseurl" <> short 'u' <> help "Server to interact with" <> value (BaseUrl Http "localhost" 3000) <> showDefaultWith showBaseUrl) 153pTPrint = TPrint <$> option (eitherReader $ first show . parseBaseUrl) (metavar "URL" <> long "baseurl" <> short 'u' <> help "Server to interact with" <> value (BaseUrl Http "localhost" 3000 "") <> showDefaultWith showBaseUrl)
152 <*> switch (long "dry-run" <> short 'n' <> help "Don't send any requests that would be expected to change the servers state") 154 <*> switch (long "dry-run" <> short 'n' <> help "Don't send any requests that would be expected to change the servers state")
153 <*> pOutput 155 <*> pOutput
154 <*> pOperation 156 <*> pOperation