summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-12-07 16:22:05 -0500
committerjoe <joe@jerkface.net>2013-12-07 16:22:05 -0500
commitb152cc6ef0c2364bfd830f34c97f46efd996cce1 (patch)
tree4807dd59702d88cd9783a7db4b1a81b7732760f9
parent1dd51df68e6f529e1c47aa4944cf625d901f704f (diff)
Added help text.
-rw-r--r--kiki.hs69
1 files changed, 68 insertions, 1 deletions
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
1537 creationTime (SignatureCreationTimePacket t) = [t] 1537 creationTime (SignatureCreationTimePacket t) = [t]
1538 creationTime _ = [] 1538 creationTime _ = []
1539 1539
1540kiki_usage = do
1541 putStr . unlines $
1542 ["kiki - a pgp key editing utility"
1543 ,""
1544 ,"kiki [OPTIONS]"
1545 ,""
1546 ," kiki merges a set of keyring files into a combined database and then"
1547 ," uses the database to update the files so that they have the most complete"
1548 ," information."
1549 ,""
1550 ," The files pubring.gpg and subring.gpg in the directory specified by the "
1551 ," --homedir option are implicitly included in the keyring set."
1552 ,""
1553 ," kiki can also import or export secret subkeys by using the --keypairs option."
1554 ,""
1555 ," Subkeys that are imported with kiki are given an annotation \"usage@\" which"
1556 ," indicates what the key is for. This tag can be used as a SPEC to select a"
1557 ," particular key. Master keys may be specified by using fingerprints or by"
1558 ," specifying a substring of an associated UID."
1559 ,""
1560 ,"Flags:"
1561 ," --homedir DIR"
1562 ," Where to find the the files secring.gpg and pubring.gpg. The "
1563 ," default location is taken from the environment variable "
1564 ," GNUPGHOME."
1565 ,""
1566 ," --passphrase-fd N"
1567 ," Read passphrase from the given file descriptor."
1568 ,""
1569 ," --import Add master keys to pubring.gpg. Without this option, only UID"
1570 ," and subkey data is updated. "
1571 ,""
1572 ," --autosign Sign all cross-certified tor-style UIDs."
1573 ," A tor-style UID is of the form:"
1574 ," Anonymous <root@HOSTNAME.onion>"
1575 ," It is considered cross certified if there exists a cross-certified"
1576 ," 'tor' subkey corresponding to the address HOSTNAME.onion."
1577 ,""
1578 ,"Merging:"
1579 ," --keyrings FILE FILE..."
1580 ," Provide keyring files other than the implicit secring.gpg and"
1581 ," pubring.gpg in the --homedir. This option is implicit unless"
1582 ," --keypairs is used."
1583 ,""
1584 ," --keypairs KEYSPEC KEYSPEC..."
1585 ," Each KEYSPEC specifies that a key should match the content and"
1586 ," timestamp of an external PKCS #1 private RSA key file."
1587 ," "
1588 ," KEYSPEC ::= SPEC=FILE{CMD} "
1589 ,""
1590 ," If neither SPEC or FILE match any keys, then the CMD will be "
1591 ," executed in order to create the FILE."
1592 ,""
1593 ,"Output:"
1594 ," --show-wk Show fingerprints for the working key (which will be used to"
1595 ," make signatures) and all its subkeys and UID."
1596 ,""
1597 ," --show-all Show fingerprints and UIDs and usage tags for all known keys."
1598 ,""
1599 ," --show-pem SPEC"
1600 ," Outputs the PKCS #8 public key corresponding to SPEC."
1601 ,""
1602 ," --help Shows this help screen."
1603 ]
1604
1540main = do 1605main = do
1541 dotlock_init 1606 dotlock_init
1542 {- 1607 {-
@@ -1568,6 +1633,7 @@ main = do
1568 , ("--show-wk",0) 1633 , ("--show-wk",0)
1569 , ("--show-all",0) 1634 , ("--show-all",0)
1570 , ("--show-pem",1) 1635 , ("--show-pem",1)
1636 , ("--help",0)
1571 ] 1637 ]
1572 args 1638 args
1573 args' = if map (take 1) (take 1 vargs) == ["-"] 1639 args' = if map (take 1) (take 1 vargs) == ["-"]
@@ -1703,7 +1769,8 @@ main = do
1703 -- On last pass, interpret --show-* commands. 1769 -- On last pass, interpret --show-* commands.
1704 let shspec = Map.fromList [("--show-wk", const $ show_wk secfile grip) 1770 let shspec = Map.fromList [("--show-wk", const $ show_wk secfile grip)
1705 ,("--show-all",const $ show_all) 1771 ,("--show-all",const $ show_all)
1706 ,("--show-pem",\[x] -> show_pem x $ maybe "" id grip) ] 1772 ,("--show-pem",\[x] -> show_pem x $ maybe "" id grip)
1773 ,("--help", \_ _ ->kiki_usage)]
1707 shargs = mapMaybe (\(x:xs) -> (,xs) <$> Map.lookup x shspec) sargs 1774 shargs = mapMaybe (\(x:xs) -> (,xs) <$> Map.lookup x shspec) sargs
1708 1775
1709 forM_ shargs $ \(cmd,args) -> cmd args use_db 1776 forM_ shargs $ \(cmd,args) -> cmd args use_db