Commit 74cb2909 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Exclude various fields from the config file

Excluded fields that make sense as command line flags but do
not make sense to use every time by saving in the config file.
parent 947a9d86
......@@ -276,16 +276,29 @@ commentSavedConfig = do
--
configFieldDescriptions :: [FieldDescr SavedConfig]
configFieldDescriptions =
toSavedConfig liftGlobalFlag (commandOptions globalCommand ParseArgs)
++ toSavedConfig liftInstallFlag (installOptions ParseArgs)
++ noInstallDirs
(toSavedConfig liftConfigFlag (configureOptions ParseArgs))
++ toSavedConfig liftUploadFlag (commandOptions uploadCommand ParseArgs)
toSavedConfig liftGlobalFlag
(commandOptions globalCommand ParseArgs)
["version", "numeric-version", "config-file"]
++ toSavedConfig liftInstallFlag
(installOptions ParseArgs)
["dry-run", "reinstall", "only"]
++ toSavedConfig liftConfigFlag
(configureOptions ParseArgs)
(["scratchdir", "configure-option"] ++ map fieldName installDirsFields)
++ toSavedConfig liftUploadFlag
(commandOptions uploadCommand ParseArgs)
["verbose", "check"]
where
toSavedConfig lift = map (lift . viewAsFieldDescr)
noInstallDirs = filter ((`notElem` installDirFieldNames) . fieldName)
installDirFieldNames = map fieldName installDirsFields
toSavedConfig lift options excluded =
[ lift field
| opt <- options
, let field = viewAsFieldDescr opt
, fieldName field `notElem` excluded ]
-- TODO: next step, make the deprecated fields elicit a warning.
--
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment