From 1e388c038d10e7586ce9f432177ab89518dab19a Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 24 Apr 2016 21:38:58 -0400 Subject: rename init-key to init. --- kiki.hs | 59 ++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 19 deletions(-) (limited to 'kiki.hs') diff --git a/kiki.hs b/kiki.hs index 32aad70..e4d8e23 100644 --- a/kiki.hs +++ b/kiki.hs @@ -697,18 +697,8 @@ kiki_usage bExport bImport bSecret cmd = putStr $ [" --help" ," Gives usage information" ,"" - ," --homedir DIR" - ," Where to find the files secring.gpg and pubring.gpg. The" - ," default location is taken from the environment variable" - ," GNUPGHOME. If this environment variable is not set and no" - ," directory is specified using this option then a hardcoded" - ," default of ~/.gnupg is assumed. " - ,"" - ," WARNING: Confusingly, this is *not* your home directory as" - ," given by the HOME environment variable. The option is named" - ," or rather misnamed in a fashion similar to the gpg option with" - ," exactly the same functionality." - ,""] ++ documentPassphraseFDFlag bExport bImport bSecret + ] ++ documentHomeDir ++ [""] + ++ documentPassphraseFDFlag bExport bImport bSecret showwk :: [String] showwk = [" --show-wk" @@ -769,6 +759,21 @@ kiki_usage bExport bImport bSecret cmd = putStr $ ," 5E24CD442AA6965D2012E62A905C24185D5379C2" ] +documentHomeDir :: [String] +documentHomeDir = + [" --homedir DIR" + ," Where to find the files secring.gpg and pubring.gpg. The" + ," default location is taken from the environment variable" + ," GNUPGHOME. If this environment variable is not set and no" + ," directory is specified using this option then a hardcoded" + ," default of ~/.gnupg is assumed. " + ,"" + ," WARNING: Confusingly, this is *not* your home directory as" + ," given by the HOME environment variable. The option is named" + ," or rather misnamed in a fashion similar to the gpg option with" + ," exactly the same functionality." + ] + documentPassphraseFDFlag bExport bImport bSecret = if bSecret then [" --passphrase-fd FD" @@ -1425,13 +1430,28 @@ kiki "merge" args = do Nothing -> error "Valid flow words are: spill,fill,sync,subkeys or match=KEYSPEC" Left (option,_) -> error $ "Unrecognized option: " ++ option -kiki "init-key" args | "--help" `elem` args = do +kiki "init" args | "--help" `elem` args = do putStr . unlines $ - [ "kiki init-key [ --passphrase-fd=FD" - , " | --home[=HOMEDIR]" - , " | --chroot=ROOTDIR ] ..."] - return () -kiki "init-key" args = do + [ "kiki init [ --passphrase-fd=FD" + , " | --home[=HOMEDIR]" + , " | --chroot=ROOTDIR ] ..." + , "" + , "Initialize a GnuPG keyring for use with kiki. After completion, you" + , "willl have a GnuPG master key with following specialized subkeys:" + , "" + , " tor - freshly generated tor hidden service key" + , " ipsec - freshly generated VPN key" + , " ssh-server - possibly read from /etc/ssh/*" + , " ssh-client - possibly read from /root/.ssh/id_rsa" + , "" + , "OPTIONS" + , "" + , " --chroot=ROOTDIR" + , " Use ROOTDIR for input of ssh keys and export files to" + , " ROOTDIR/var/cache/kiki instead of the current system path." + , "" + ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True +kiki "init" args = do me <- getEffectiveUserID {- if me/=0 then error "This command requires root." else do @@ -1860,7 +1880,8 @@ commands = , ( "export-secret", "export (both public and secret) information into your keyring" ) , ( "export-public", "import (public) information into your keyring" ) , ( "merge", "low level import/export operation" ) - , ( "init-key", "initialize the samizdat key ring") + -- , ( "init-key", "initialize the samizdat key ring") + , ( "init", "Initialize kiki") , ( "delete", "Delete a subkey and its associated signatures" ) , ( "tar", "import or export system key files in tar format" ) ] -- cgit v1.2.3