From b152cc6ef0c2364bfd830f34c97f46efd996cce1 Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 7 Dec 2013 16:22:05 -0500 Subject: Added help text. --- kiki.hs | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/kiki.hs b/kiki.hs index 5d29a6e..f49f170 100644 --- a/kiki.hs +++ b/kiki.hs @@ -1537,6 +1537,71 @@ signature_time ov = case if null cs then ds else cs of creationTime (SignatureCreationTimePacket t) = [t] creationTime _ = [] +kiki_usage = do + putStr . unlines $ + ["kiki - a pgp key editing utility" + ,"" + ,"kiki [OPTIONS]" + ,"" + ," kiki merges a set of keyring files into a combined database and then" + ," uses the database to update the files so that they have the most complete" + ," information." + ,"" + ," The files pubring.gpg and subring.gpg in the directory specified by the " + ," --homedir option are implicitly included in the keyring set." + ,"" + ," kiki can also import or export secret subkeys by using the --keypairs option." + ,"" + ," Subkeys that are imported with kiki are given an annotation \"usage@\" which" + ," indicates what the key is for. This tag can be used as a SPEC to select a" + ," particular key. Master keys may be specified by using fingerprints or by" + ," specifying a substring of an associated UID." + ,"" + ,"Flags:" + ," --homedir DIR" + ," Where to find the the files secring.gpg and pubring.gpg. The " + ," default location is taken from the environment variable " + ," GNUPGHOME." + ,"" + ," --passphrase-fd N" + ," Read passphrase from the given file descriptor." + ,"" + ," --import Add master keys to pubring.gpg. Without this option, only UID" + ," and subkey data is updated. " + ,"" + ," --autosign Sign all cross-certified tor-style UIDs." + ," A tor-style UID is of the form:" + ," Anonymous " + ," It is considered cross certified if there exists a cross-certified" + ," 'tor' subkey corresponding to the address HOSTNAME.onion." + ,"" + ,"Merging:" + ," --keyrings FILE FILE..." + ," Provide keyring files other than the implicit secring.gpg and" + ," pubring.gpg in the --homedir. This option is implicit unless" + ," --keypairs is used." + ,"" + ," --keypairs KEYSPEC KEYSPEC..." + ," Each KEYSPEC specifies that a key should match the content and" + ," timestamp of an external PKCS #1 private RSA key file." + ," " + ," KEYSPEC ::= SPEC=FILE{CMD} " + ,"" + ," If neither SPEC or FILE match any keys, then the CMD will be " + ," executed in order to create the FILE." + ,"" + ,"Output:" + ," --show-wk Show fingerprints for the working key (which will be used to" + ," make signatures) and all its subkeys and UID." + ,"" + ," --show-all Show fingerprints and UIDs and usage tags for all known keys." + ,"" + ," --show-pem SPEC" + ," Outputs the PKCS #8 public key corresponding to SPEC." + ,"" + ," --help Shows this help screen." + ] + main = do dotlock_init {- @@ -1568,6 +1633,7 @@ main = do , ("--show-wk",0) , ("--show-all",0) , ("--show-pem",1) + , ("--help",0) ] args args' = if map (take 1) (take 1 vargs) == ["-"] @@ -1703,7 +1769,8 @@ main = do -- On last pass, interpret --show-* commands. let shspec = Map.fromList [("--show-wk", const $ show_wk secfile grip) ,("--show-all",const $ show_all) - ,("--show-pem",\[x] -> show_pem x $ maybe "" id grip) ] + ,("--show-pem",\[x] -> show_pem x $ maybe "" id grip) + ,("--help", \_ _ ->kiki_usage)] shargs = mapMaybe (\(x:xs) -> (,xs) <$> Map.lookup x shspec) sargs forM_ shargs $ \(cmd,args) -> cmd args use_db -- cgit v1.2.3