diff --git a/brittany.cabal b/brittany.cabal index 2cd732b..096538a 100644 --- a/brittany.cabal +++ b/brittany.cabal @@ -78,7 +78,7 @@ library { , bytestring >=0.10.8.1 && <0.11 , directory >=1.2.6.2 && <1.3 , lens - , butcher + , butcher >=0.2.0.0 && <0.3 , yaml >=0.8.18 && <0.9 , extra >=1.4.10 && <1.5 , uniplate >=1.6.12 && <1.7 diff --git a/src-brittany/Main.hs b/src-brittany/Main.hs index a8db774..1e16143 100644 --- a/src-brittany/Main.hs +++ b/src-brittany/Main.hs @@ -65,9 +65,9 @@ mainCmdParser = do reorderStart printHelp <- addSimpleBoolFlag "" ["help"] mempty printVersion <- addSimpleBoolFlag "" ["version"] mempty - inputPaths <- addFlagStringParam "i" ["input"] "PATH" (flagHelpStr "path to input haskell source file") - outputPaths <- addFlagStringParam "o" ["output"] "PATH" (flagHelpStr "output file path") - configPaths <- addFlagStringParam "" ["config-file"] "PATH" (flagHelpStr "path to config file") -- TODO: allow default on addFlagStringParam ? + inputPaths <- addFlagStringParams "i" ["input"] "PATH" (flagHelpStr "path to input haskell source file") + outputPaths <- addFlagStringParams "o" ["output"] "PATH" (flagHelpStr "output file path") + configPaths <- addFlagStringParams "" ["config-file"] "PATH" (flagHelpStr "path to config file") -- TODO: allow default on addFlagStringParam ? cmdlineConfig <- configParser suppressOutput <- addSimpleBoolFlag "" ["suppress-output"] (flagHelp $ parDoc "suppress the regular output, i.e. the transformed haskell source") _verbosity <- addSimpleCountFlag "v" ["verbose"] (flagHelp $ parDoc "[currently without effect; TODO]") diff --git a/src/Language/Haskell/Brittany/Config.hs b/src/Language/Haskell/Brittany/Config.hs index 90f7ff3..b281d9c 100644 --- a/src/Language/Haskell/Brittany/Config.hs +++ b/src/Language/Haskell/Brittany/Config.hs @@ -35,9 +35,9 @@ import Data.Coerce ( Coercible, coerce ) configParser :: CmdParser Identity out (ConfigF Option) configParser = do -- TODO: why does the default not trigger; ind never should be []!! - ind <- addFlagReadParam "" ["indent"] "AMOUNT" (flagHelpStr "spaces per indentation level") - cols <- addFlagReadParam "" ["columns"] "AMOUNT" (flagHelpStr "target max columns (80 is an old default for this)") - importCol <- addFlagReadParam "" ["import-col"] "N" (flagHelpStr "column to align import lists at") + ind <- addFlagReadParams "" ["indent"] "AMOUNT" (flagHelpStr "spaces per indentation level") + cols <- addFlagReadParams "" ["columns"] "AMOUNT" (flagHelpStr "target max columns (80 is an old default for this)") + importCol <- addFlagReadParams "" ["import-col"] "N" (flagHelpStr "column to align import lists at") dumpConfig <- addSimpleBoolFlag "" ["dump-config"] (flagHelp $ parDoc "dump the programs full config (commandline + file + defaults)") dumpAnnotations <- addSimpleBoolFlag "" ["dump-annotations"] (flagHelp $ parDoc "dump the full annotations returned by ghc-exactprint") @@ -56,7 +56,7 @@ configParser = do outputOnErrors <- addSimpleBoolFlag "" ["output-on-errors"] (flagHelp $ parDoc "even when there are errors, produce output (or try to to the degree possible") wError <- addSimpleBoolFlag "" ["werror"] (flagHelp $ parDoc "treat warnings as errors") - optionsGhc <- addFlagStringParam + optionsGhc <- addFlagStringParams "" ["ghc-options"] "STRING" diff --git a/stack.yaml b/stack.yaml index ad5b142..68b933f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,7 +7,7 @@ packages: - . - extra-dep: true location: - commit: e0885a4f482c063862e38db7de4319f3786c7a28 + commit: 8b721f7e17a20a338432f1d31ef55db5e50b8e8d git: https://github.com/lspitzner/butcher.git - extra-dep: true location: