Skip to content

ghcup config unset #1058

@hasufell

Description

@hasufell

Following #1057

We have user settings:

data UserSettings = UserSettings
  { uCache             :: Maybe Bool
  , uMetaCache         :: Maybe Integer
  , uMetaMode          :: Maybe MetaMode
  , uNoVerify          :: Maybe Bool
  , uVerbose           :: Maybe Bool
  , uKeepDirs          :: Maybe KeepDirs
  , uDownloader        :: Maybe Downloader
  , uKeyBindings       :: Maybe UserKeyBindings
  , uUrlSource         :: Maybe URLSource
  , uNoNetwork         :: Maybe Bool
  , uGPGSetting        :: Maybe GPGSetting
  , uPlatformOverride  :: Maybe PlatformRequest
  , uMirrors           :: Maybe DownloadMirrors
  , uDefGHCConfOptions :: Maybe [String]
  }

And the actual settings:

data Settings = Settings
  { cache             :: Bool
  , metaCache         :: Integer
  , metaMode          :: MetaMode
  , noVerify          :: Bool
  , keepDirs          :: KeepDirs
  , downloader        :: Downloader
  , verbose           :: Bool
  , urlSource         :: URLSource
  , noNetwork         :: Bool
  , gpgSetting        :: GPGSetting
  , noColor           :: Bool -- this also exists in LoggerConfig
  , platformOverride  :: Maybe PlatformRequest
  , mirrors           :: DownloadMirrors
  , defGHCConfOptions :: [String]
  }

platformOverride here is special, since it's the only Maybe that gets passed through. In UserSettings, all records are Maybe, so we can unset any key.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions