{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE NoFieldSelectors  #-}

-- | Types for command line options for the @stack upload@ command.

module Stack.Types.UploadOpts
  ( UploadOpts (..)
  , UploadVariant (..)
  ) where

import           Stack.Prelude
import           Stack.Types.PvpBounds (PvpBounds)

-- | Type representing command line options for the @stack upload@ command.

data UploadOpts = UploadOpts
  { UploadOpts -> [String]
itemsToWorkWith :: ![String]
    -- ^ The items to work with.

  , UploadOpts -> Bool
documentation :: !Bool
    -- ^ Uploading documentation for packages?

  , UploadOpts -> Maybe PvpBounds
pvpBounds :: !(Maybe PvpBounds)
  , UploadOpts -> Bool
check :: !Bool
  , UploadOpts -> Bool
buildPackage :: !Bool
  , UploadOpts -> Maybe String
tarPath :: !(Maybe FilePath)
  , UploadOpts -> UploadVariant
uploadVariant :: !UploadVariant
  , UploadOpts -> FirstTrue
saveHackageCreds :: !FirstTrue
    -- ^ Save user's Hackage username and password in a local file?

  }

-- | Type representing variants for uploading to Hackage.

data UploadVariant
  = Publishing
    -- ^ Publish the package/a published package.

  | Candidate
    -- ^ Create a package candidate/a package candidate.