aboutsummaryrefslogtreecommitdiff
path: root/tprint
diff options
context:
space:
mode:
Diffstat (limited to 'tprint')
-rw-r--r--tprint/src/Options.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tprint/src/Options.hs b/tprint/src/Options.hs
index 96bbde6..e9dcfe6 100644
--- a/tprint/src/Options.hs
+++ b/tprint/src/Options.hs
@@ -6,6 +6,7 @@ module Options
6 , Operation(..) 6 , Operation(..)
7 , Input, Output 7 , Input, Output
8 , Format(..), Source(..), Sink(..) 8 , Format(..), Source(..), Sink(..)
9 , supportedInputs, supportedOutputs
9 , withArgs 10 , withArgs
10 , module Options.Utils 11 , module Options.Utils
11 ) where 12 ) where
@@ -75,6 +76,10 @@ data Source = Stdin | ReadFile FilePath
75data Sink = Stdout | WriteFile FilePath 76data Sink = Stdout | WriteFile FilePath
76 deriving (Show, Generic, PrettyVal) 77 deriving (Show, Generic, PrettyVal)
77 78
79supportedInputs, supportedOutputs :: [Format]
80supportedInputs = [BBCode]
81supportedOutputs = [Human]
82
78cmdPrinters :: ParserInfo Operation 83cmdPrinters :: ParserInfo Operation
79cmdPrinters = info cmdPrinters' $ mconcat [ header "List all available printers" 84cmdPrinters = info cmdPrinters' $ mconcat [ header "List all available printers"
80 ] 85 ]
@@ -104,7 +109,7 @@ pTPrint = TPrint <$> option (eitherReader parseBaseUrl) (metavar "URL" <> long "
104pOutput :: Parser Output 109pOutput :: Parser Output
105pOutput = (,) <$> pOutputFormat <*> pSink 110pOutput = (,) <$> pOutputFormat <*> pSink
106 where 111 where
107 pOutputFormat = option rCI $ metavar "FORMAT" <> long "output-format" <> short 'O' <> help ("Format to use for all output (possible values: " ++ show ([minBound..maxBound] :: [Format]) ++ ")") <> value Human <> showDefault 112 pOutputFormat = option rCI $ metavar "FORMAT" <> long "output-format" <> short 'O' <> help ("Format to use for all output (possible values: " ++ show supportedOutputs ++ ")") <> value (head supportedOutputs) <> showDefault
108 pSink = option rSink $ metavar "PATH" <> long "output" <> short 'o' <> help "Send output to PATH (`-' means stdout)" <> value Stdout <> showDefault 113 pSink = option rSink $ metavar "PATH" <> long "output" <> short 'o' <> help "Send output to PATH (`-' means stdout)" <> value Stdout <> showDefault
109 rSink = rSink' <$> str 114 rSink = rSink' <$> str
110 where 115 where