summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs40
1 files changed, 31 insertions, 9 deletions
diff --git a/kiki.hs b/kiki.hs
index c00ab84..a50c237 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -461,7 +461,7 @@ kiki_usage bSecret cmd = putStr $
461 ,"" 461 ,""
462 ," --key SPEC" 462 ," --key SPEC"
463 ," Show fingerprints for the specified key and all its subkeys" 463 ," Show fingerprints for the specified key and all its subkeys"
464 ," and UID." 464 ," and UID. (See 'kiki help spec' for more information.)"
465 ,"" 465 ,""
466 ," --all Show fingerprints and UIDs and usage tags for all known keys." 466 ," --all Show fingerprints and UIDs and usage tags for all known keys."
467 ,"" 467 ,""
@@ -471,15 +471,19 @@ kiki_usage bSecret cmd = putStr $
471 ,"" 471 ,""
472 ," --pem SPEC" 472 ," --pem SPEC"
473 ," Outputs the PKCS #8 public key corresponding to SPEC." 473 ," Outputs the PKCS #8 public key corresponding to SPEC."
474 ," (See 'kiki help spec' for more information.)"
474 ,"" 475 ,""
475 ," --cert SPEC" 476 ," --cert SPEC"
476 ," Outputs X509 certificates associated with the key SPEC." 477 ," Outputs X509 certificates associated with the key SPEC."
478 ," (See 'kiki help spec' for more information.)"
477 ,"" 479 ,""
478 ," --ssh SPEC" 480 ," --ssh SPEC"
479 ," Outputs the ssh-rsa blob for the specified public key." 481 ," Outputs the ssh-rsa blob for the specified public key."
482 ," (See 'kiki help spec' for more information.)"
480 ,"" 483 ,""
481 ," --wip SPEC" 484 ," --wip SPEC"
482 ," Outputs the secret crypto-coin key in Wallet Input Format." 485 ," Outputs the secret crypto-coin key in Wallet Input Format."
486 ," (See 'kiki help spec' for more information.)"
483 ,"" 487 ,""
484 ," --torhash FILE" 488 ," --torhash FILE"
485 ," Outputs tor address and base32 hash of the PEM-format key in" 489 ," Outputs tor address and base32 hash of the PEM-format key in"
@@ -487,7 +491,7 @@ kiki_usage bSecret cmd = putStr $
487 ,"" 491 ,""
488 ," --help Shows this help screen." 492 ," --help Shows this help screen."
489 ,"" 493 ,""
490 ] ++ keyspec 494 ]
491 "sync-secret" -> unlines $ 495 "sync-secret" -> unlines $
492 ["kiki sync-secret [options...]" 496 ["kiki sync-secret [options...]"
493 ,"" 497 ,""
@@ -502,7 +506,9 @@ kiki_usage bSecret cmd = putStr $
502 ," indicates what the key is for. This tag can be used as a SPEC to select a" 506 ," indicates what the key is for. This tag can be used as a SPEC to select a"
503 ," particular key. Master keys may be specified by using fingerprints or by" 507 ," particular key. Master keys may be specified by using fingerprints or by"
504 ," specifying a substring of an associated UID." 508 ," specifying a substring of an associated UID."
505 ] ++ syncflags ++ keyspec 509 ,""
510 ," (See 'kiki help spec' for more information.)"
511 ] ++ syncflags
506 "sync-public" -> unlines $ 512 "sync-public" -> unlines $
507 ["kiki sync-public [options...]" 513 ["kiki sync-public [options...]"
508 ,"" 514 ,""
@@ -521,7 +527,9 @@ kiki_usage bSecret cmd = putStr $
521 ," indicates what the key is for. This tag can be used as a SPEC to select a" 527 ," indicates what the key is for. This tag can be used as a SPEC to select a"
522 ," particular key. Master keys may be specified by using fingerprints or by" 528 ," particular key. Master keys may be specified by using fingerprints or by"
523 ," specifying a substring of an associated UID." 529 ," specifying a substring of an associated UID."
524 ] ++ syncflags ++ keyspec 530 ,""
531 ," (See 'kiki help spec' for more information.)"
532 ] ++ syncflags
525 "import-secret" -> unlines $ 533 "import-secret" -> unlines $
526 ["kiki import-secret [options...]" 534 ["kiki import-secret [options...]"
527 ,"" 535 ,""
@@ -535,7 +543,9 @@ kiki_usage bSecret cmd = putStr $
535 ," indicates what the key is for. This tag can be used as a SPEC to select a" 543 ," indicates what the key is for. This tag can be used as a SPEC to select a"
536 ," particular key. Master keys may be specified by using fingerprints or by" 544 ," particular key. Master keys may be specified by using fingerprints or by"
537 ," specifying a substring of an associated UID." 545 ," specifying a substring of an associated UID."
538 ] ++ syncflags ++ keyspec 546 ,""
547 ," (See 'kiki help spec' for more information.)"
548 ] ++ syncflags
539 "import-public" -> unlines $ 549 "import-public" -> unlines $
540 ["kiki import-public [options...]" 550 ["kiki import-public [options...]"
541 ,"" 551 ,""
@@ -554,7 +564,9 @@ kiki_usage bSecret cmd = putStr $
554 ," indicates what the key is for. This tag can be used as a SPEC to select a" 564 ," indicates what the key is for. This tag can be used as a SPEC to select a"
555 ," particular key. Master keys may be specified by using fingerprints or by" 565 ," particular key. Master keys may be specified by using fingerprints or by"
556 ," specifying a substring of an associated UID." 566 ," specifying a substring of an associated UID."
557 ] ++ syncflags ++ keyspec 567 ,""
568 ," (See 'kiki help spec' for more information.)"
569 ] ++ syncflags
558 "export-secret" -> unlines $ 570 "export-secret" -> unlines $
559 ["kiki export-secret [options...]" 571 ["kiki export-secret [options...]"
560 ,"" 572 ,""
@@ -563,7 +575,9 @@ kiki_usage bSecret cmd = putStr $
563 ," The files pubring.gpg and secring.gpg in the directory specified by the " 575 ," The files pubring.gpg and secring.gpg in the directory specified by the "
564 ," --homedir option are implicitly included in the keyring set." 576 ," --homedir option are implicitly included in the keyring set."
565 ,"" 577 ,""
566 ] ++ syncflags ++ keyspec 578 ," (See 'kiki help spec' for more information.)"
579 ,""
580 ] ++ syncflags
567 "export-public" -> unlines $ 581 "export-public" -> unlines $
568 ["kiki export-public [options...]" 582 ["kiki export-public [options...]"
569 ,"" 583 ,""
@@ -574,7 +588,10 @@ kiki_usage bSecret cmd = putStr $
574 ," difference betwen this command and export-secret is that no secret keys are" 588 ," difference betwen this command and export-secret is that no secret keys are"
575 ," exported by this command regardless of input." 589 ," exported by this command regardless of input."
576 ,"" 590 ,""
577 ] ++ syncflags ++ keyspec 591 ," (See 'kiki help spec' for more information.)"
592 ,""
593 ] ++ syncflags
594 "spec" -> unlines keyspec
578 where 595 where
579 commonOptions :: [String] 596 commonOptions :: [String]
580 commonOptions = 597 commonOptions =
@@ -631,7 +648,7 @@ kiki_usage bSecret cmd = putStr $
631 ," " 648 ," "
632 ," KEYSPEC ::= SPEC=FILE{CMD} " 649 ," KEYSPEC ::= SPEC=FILE{CMD} "
633 ,"" 650 ,""
634 ," The form of SPEC is documented below. If there is only one master" 651 ," The form of SPEC is documented elsewhere. If there is only one master"
635 ," key in your keyring and only one key is used for each purpose, then" 652 ," key in your keyring and only one key is used for each purpose, then"
636 ," it is possible for SPEC in this case to merely be a tag which offers" 653 ," it is possible for SPEC in this case to merely be a tag which offers"
637 ," information about what this key is used for, for example, any of" 654 ," information about what this key is used for, for example, any of"
@@ -639,6 +656,7 @@ kiki_usage bSecret cmd = putStr $
639 ,"" 656 ,""
640 ," If neither SPEC or FILE match any keys, then the CMD will be " 657 ," If neither SPEC or FILE match any keys, then the CMD will be "
641 ," executed in order to create the FILE." 658 ," executed in order to create the FILE."
659 ," (See 'kiki help spec' for more information.)"
642 ,""] 660 ,""]
643 keyspec = -- unlines $ 661 keyspec = -- unlines $
644 ["Specifying keys on the kiki command line:" 662 ["Specifying keys on the kiki command line:"
@@ -843,6 +861,7 @@ sync bExport bImport bSecret cmdarg args_raw = do
843 forM_ report $ \(fname,act) -> do 861 forM_ report $ \(fname,act) -> do
844 putStrLn $ fname ++ ": " ++ reportString act 862 putStrLn $ fname ++ ": " ++ reportString act
845 863
864
846kiki "sync-secret" args_raw = 865kiki "sync-secret" args_raw =
847 sync True True True "sync-secret" args_raw 866 sync True True True "sync-secret" args_raw
848 867
@@ -879,10 +898,13 @@ kiki "help" [] = do
879 putStrLn $ " " ++ pad cmd ++ help 898 putStrLn $ " " ++ pad cmd ++ help
880 putStr . unlines $ ["" 899 putStr . unlines $ [""
881 ,"See 'kiki help <command>' for more information on a specific command." 900 ,"See 'kiki help <command>' for more information on a specific command."
901 ,"Or see 'kiki help spec' for kiki's notation for specifying keys."
882 ] 902 ]
883 return () 903 return ()
884 904
885kiki "help" args = forM_ args $ \arg -> case lookup arg commands of 905kiki "help" args = forM_ args $ \arg -> case lookup arg commands of
906 Nothing | arg == "spec" -> kiki_usage False arg
907 Nothing | arg == "SPEC" -> kiki_usage False arg
886 Nothing -> putStrLn $ "No help available for commmand '" ++ arg ++ "'." 908 Nothing -> putStrLn $ "No help available for commmand '" ++ arg ++ "'."
887 _ -> kiki arg ["--help"] 909 _ -> kiki arg ["--help"]
888 910