mirror of
https://github.com/NorfairKing/feedback.git
synced 2024-11-30 02:06:04 +03:00
Fixed a bug in which the --no-clear flag was not respected
This commit is contained in:
parent
e25bf7aea4
commit
343ab6a5a8
@ -32,8 +32,6 @@ library
|
||||
, autodocodec-yaml
|
||||
, base >=4.7 && <5
|
||||
, bytestring
|
||||
, conduit
|
||||
, conduit-extra
|
||||
, containers
|
||||
, cursor
|
||||
, envparse
|
||||
@ -42,6 +40,7 @@ library
|
||||
, optparse-applicative
|
||||
, path
|
||||
, path-io
|
||||
, pretty-show
|
||||
, process
|
||||
, safe-coloured-text
|
||||
, safe-coloured-text-terminfo
|
||||
|
@ -16,9 +16,6 @@ library:
|
||||
- autodocodec
|
||||
- autodocodec-yaml
|
||||
- bytestring
|
||||
- conduit
|
||||
- conduit-extra
|
||||
- containers
|
||||
- containers
|
||||
- cursor
|
||||
- envparse
|
||||
@ -27,6 +24,7 @@ library:
|
||||
- optparse-applicative
|
||||
- path
|
||||
- path-io
|
||||
- pretty-show
|
||||
- process
|
||||
- safe-coloured-text
|
||||
- safe-coloured-text-terminfo
|
||||
|
@ -23,6 +23,7 @@ import Options.Applicative as OptParse
|
||||
import qualified Options.Applicative.Help as OptParse (string)
|
||||
import Path
|
||||
import Path.IO
|
||||
import Text.Show.Pretty (pPrint)
|
||||
|
||||
getSettings :: IO Settings
|
||||
getSettings = do
|
||||
@ -64,12 +65,14 @@ combineToSettings Flags {..} Environment {} mConf = do
|
||||
"as the name of a configured loop"
|
||||
]
|
||||
pure loopConfigCommand
|
||||
let settingOutputSettings = combineToOutputSettings (mConf >>= configOutputConfiguration)
|
||||
pure Settings {..}
|
||||
let settingOutputSettings = combineToOutputSettings flagOutputFlags (mConf >>= configOutputConfiguration)
|
||||
let settings = Settings {..}
|
||||
when flagDebug $ pPrint settings
|
||||
pure settings
|
||||
|
||||
combineToOutputSettings :: Maybe OutputConfiguration -> OutputSettings
|
||||
combineToOutputSettings mConf =
|
||||
let outputSettingClear = fromMaybe ClearScreen $ mConf >>= outputConfigClear
|
||||
combineToOutputSettings :: OutputFlags -> Maybe OutputConfiguration -> OutputSettings
|
||||
combineToOutputSettings OutputFlags {..} mConf =
|
||||
let outputSettingClear = fromMaybe ClearScreen $ outputFlagClear <|> (mConf >>= outputConfigClear)
|
||||
in OutputSettings {..}
|
||||
|
||||
data Configuration = Configuration
|
||||
@ -166,7 +169,8 @@ flagsParser =
|
||||
data Flags = Flags
|
||||
{ flagConfigFile :: !(Maybe FilePath),
|
||||
flagCommand :: !String,
|
||||
flagOutputFlags :: !OutputFlags
|
||||
flagOutputFlags :: !OutputFlags,
|
||||
flagDebug :: Bool
|
||||
}
|
||||
deriving (Show, Eq, Generic)
|
||||
|
||||
@ -197,6 +201,7 @@ parseFlags =
|
||||
)
|
||||
)
|
||||
<*> parseOutputFlags
|
||||
<*> switch (mconcat [long "debug", help "show debug information"])
|
||||
|
||||
parseOutputFlags :: OptParse.Parser OutputFlags
|
||||
parseOutputFlags =
|
||||
|
Loading…
Reference in New Issue
Block a user