summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
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."