summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-31 14:30:35 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-31 14:33:22 -0400
commit019c080687ce4a07031bdfe2263397f4f868c3c3 (patch)
tree187c7abb67ce1c0bc126a48501de4e7ed3e1f7e0 /CmdLine.hs
parent176dbd5798a7def03ea6c61713a0c216ab1e1674 (diff)
downloadkeysafe-019c080687ce4a07031bdfe2263397f4f868c3c3.tar.gz
added --store-directory
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index a8201c8..05ba7da 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -6,6 +6,7 @@
module CmdLine where
import Types
+import Types.Storage
import Tunables
import qualified Gpg
import Options.Applicative
@@ -17,6 +18,7 @@ data CmdLine = CmdLine
{ mode :: Maybe Mode
, secretkeysource :: Maybe SecretKeySource
, localstorage :: Bool
+ , localstoragedirectory :: Maybe LocalStorageDirectory
, gui :: Bool
, testMode :: Bool
, customShareParams :: Maybe ShareParams
@@ -36,6 +38,7 @@ parse = CmdLine
<$> optional (backup <|> restore <|> uploadqueued <|> server <|> benchmark <|> test)
<*> optional (gpgswitch <|> fileswitch)
<*> localstorageswitch
+ <*> localstoragedirectory
<*> guiswitch
<*> testmodeswitch
<*> optional (ShareParams <$> totalobjects <*> neededobjects)
@@ -77,7 +80,12 @@ parse = CmdLine
)
localstorageswitch = switch
( long "store-local"
- <> help "Store data locally, in ~/.keysafe/objects/local/. (The default is to store data in the cloud.)"
+ <> help "Store data locally. (The default is to store data in the cloud.)"
+ )
+ localstoragedirectory = optional $ LocalStorageDirectory <$> option str
+ ( long "store-directory"
+ <> metavar "DIR"
+ <> help "Where to store data locally. (default: ~/.keysafe/objects/)"
)
testmodeswitch = switch
( long "testmode"