diff options
author | guilhem <guilhem@fripost.org> | 2013-03-11 02:33:13 +0100 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-11 09:48:38 -0400 |
commit | 7fa1e498de9cbb84b23f90b17c66d755292ae716 (patch) | |
tree | dc1f5127473d3450b138b4aedfe43a5248d42939 /Utility | |
parent | f2292dc3b494dbed517a48ab2876594f5ace0179 (diff) |
GnuPG options for symmetric encryption.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Gpg/Types.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Utility/Gpg/Types.hs b/Utility/Gpg/Types.hs new file mode 100644 index 000000000..d45707207 --- /dev/null +++ b/Utility/Gpg/Types.hs @@ -0,0 +1,30 @@ +{- gpg data types + - + - Copyright 2013 guilhem <guilhem@fripost.org> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Utility.Gpg.Types where + +import Utility.SafeCommand +import Types.GitConfig +import Types.Remote + +{- GnuPG options. -} +type GpgOpt = String +newtype GpgOpts = GpgOpts [GpgOpt] + +toParams :: GpgOpts -> [CommandParam] +toParams (GpgOpts opts) = map Param opts + +class LensGpgOpts a where + getGpgOpts :: a -> GpgOpts + +{- Extract the GnuPG options from a Remote Git Config. -} +instance LensGpgOpts RemoteGitConfig where + getGpgOpts = GpgOpts . remoteAnnexGnupgOptions + +{- Extract the GnuPG options from a Remote. -} +instance LensGpgOpts (RemoteA a) where + getGpgOpts = getGpgOpts . gitconfig |