summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-17 15:23:00 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-17 15:23:00 -0400
commit41bfb68ee296a4ecdcbd9c02d242d6c9e149b7b8 (patch)
tree55e456e9e56cdc1c584c1a090536a05eec791495 /CmdLine.hs
parente32b20fe15175136bc98b25a002c5acc495679eb (diff)
downloadkeysafe-41bfb68ee296a4ecdcbd9c02d242d6c9e149b7b8.tar.gz
make storage to use configurable on command line
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 6413cf7..93828bc 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -10,14 +10,17 @@ import qualified Gpg
import Options.Applicative
import qualified Data.ByteString.UTF8 as BU8
import System.Directory
+import Storage
+import Storage.Local
+import Storage.Network
data CmdLine = CmdLine
{ mode :: Maybe Mode
, secretkeysource :: Maybe SecretKeySource
- , testMode :: Bool
+ , storage :: Storage
, gui :: Bool
+ , testMode :: Bool
}
- deriving (Show)
data Mode = Backup | Restore | Benchmark
deriving (Show)
@@ -26,8 +29,9 @@ parse :: Parser CmdLine
parse = CmdLine
<$> optional (backup <|> restore <|> benchmark)
<*> optional (gpgswitch <|> fileswitch)
- <*> testmodeswitch
+ <*> localstorageflag
<*> guiswitch
+ <*> testmodeswitch
where
backup = flag' Backup
( long "backup"
@@ -49,6 +53,10 @@ parse = CmdLine
( long "keyfile"
<> help "Specify secret key file to back up or restore. (The same filename must be used to restore a key as was used to back it up.)"
)
+ localstorageflag = flag networkStorage localStorage
+ ( long "store-local"
+ <> help "Store data locally, in ~/.keysafe/objects. (The default is to store data in the cloud.)"
+ )
testmodeswitch = switch
( long "testmode"
<> help "Avoid using expensive cryptographic operation to secure key. Use for testing only, not with real secret keys."