@@ -15,21 +15,15 @@ import Paths_ormolu (version)
1515import System.Exit (ExitCode (..), exitWith)
1616import System.IO (hPutStrLn, stderr)
1717import qualified Data.Text.IO as TIO
18−import qualified Data.Yaml as Yaml
1918
2019-- | Entry point of the program.
2120
2221main :: IO ()
2322main = withPrettyOrmoluExceptions $ do
2423 Opts {..} <- execParser optsParserInfo
25− config <- case optConfigFile of
26− Nothing -> return optConfig
27− Just path -> do
28− config <- Yaml.decodeFileThrow path
29− return (config <> optConfig)
3024 r <- case optInputFile of
31− "-" -> ormoluStdin config
32− inputFile -> ormoluFile config inputFile
25+ "-" -> ormoluStdin optConfig
26+ inputFile -> ormoluFile optConfig inputFile
3327 let notForStdin = do
3428 when (optInputFile == "-") $ do
3529 hPutStrLn
@@ -58,8 +52,6 @@ main = withPrettyOrmoluExceptions $ do
5852data Opts = Opts
5953 { optMode :: !Mode
6054 -- ^ Mode of operation
61− , optConfigFile :: !(Maybe FilePath)
62− -- ^ Location of configuration file (optional)
6355 , optConfig :: !Config
6456 -- ^ Ormolu 'Config'
6557 , optInputFile :: !FilePath
@@ -107,12 +99,6 @@ optsParser = Opts
10799 , value Stdout
108100 , help "Mode of operation: 'stdout', 'inplace', or 'check'"
109101 ]
110− <*> (optional . strOption . mconcat)
111− [ long "config"
112− , short 'c'
113− , metavar "CONFIG"
114− , help "Location of configuration file"
115− ]
116102 <*> configParser
117103 <*> (strArgument . mconcat)
118104 [ metavar "FILE"