diff options
| -rw-r--r-- | tprint/src/Options.hs | 7 |
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 | |||
| 75 | data Sink = Stdout | WriteFile FilePath | 76 | data Sink = Stdout | WriteFile FilePath |
| 76 | deriving (Show, Generic, PrettyVal) | 77 | deriving (Show, Generic, PrettyVal) |
| 77 | 78 | ||
| 79 | supportedInputs, supportedOutputs :: [Format] | ||
| 80 | supportedInputs = [BBCode] | ||
| 81 | supportedOutputs = [Human] | ||
| 82 | |||
| 78 | cmdPrinters :: ParserInfo Operation | 83 | cmdPrinters :: ParserInfo Operation |
| 79 | cmdPrinters = info cmdPrinters' $ mconcat [ header "List all available printers" | 84 | cmdPrinters = info cmdPrinters' $ mconcat [ header "List all available printers" |
| 80 | ] | 85 | ] |
| @@ -104,7 +109,7 @@ pTPrint = TPrint <$> option (eitherReader parseBaseUrl) (metavar "URL" <> long " | |||
| 104 | pOutput :: Parser Output | 109 | pOutput :: Parser Output |
| 105 | pOutput = (,) <$> pOutputFormat <*> pSink | 110 | pOutput = (,) <$> 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 |
