diff options
Diffstat (limited to 'tprint/src')
-rw-r--r-- | tprint/src/Options.hs | 4 |
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 () | |||
26 | import Paths_tprint (version) | 26 | import Paths_tprint (version) |
27 | import Data.Version (showVersion) | 27 | import Data.Version (showVersion) |
28 | 28 | ||
29 | import Data.Bifunctor (Bifunctor(..)) | ||
30 | |||
29 | data TPrint = TPrint | 31 | data 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 | ||
150 | pTPrint :: Parser TPrint | 152 | pTPrint :: Parser TPrint |
151 | pTPrint = TPrint <$> option (eitherReader parseBaseUrl) (metavar "URL" <> long "baseurl" <> short 'u' <> help "Server to interact with" <> value (BaseUrl Http "localhost" 3000) <> showDefaultWith showBaseUrl) | 153 | pTPrint = 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 |