diff options
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -11,7 +11,7 @@ import qualified Data.ByteString.UTF8 as BU8 data CmdLine = CmdLine { mode :: Mode - , keytype :: KeyType + , secretkeysource :: Maybe SecretKeySource , testMode :: Bool , gui :: Bool } @@ -23,7 +23,7 @@ data Mode = Backup | Restore | Benchmark parse :: Parser CmdLine parse = CmdLine <$> (backup <|> restore <|> benchmark) - <*> keytypeopt + <*> optional (gpgswitch <|> fileswitch) <*> testmodeswitch <*> guiswitch where @@ -39,9 +39,13 @@ parse = CmdLine ( long "benchmark" <> help "Benchmark speed of keysafe's cryptographic primitives." ) - keytypeopt = KeyType . BU8.fromString <$> strOption - ( long "type" - <> help "Type of key (eg, \"gpg\")." + gpgswitch = GpgKey . KeyId . BU8.fromString <$> strOption + ( long "gpgkeyid" + <> help "Specify keyid of gpg key to back up or restore." + ) + fileswitch = KeyFile <$> strOption + ( 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.)" ) testmodeswitch = switch ( long "testmode" |