diff options
-rw-r--r-- | cokiki.hs | 10 | ||||
-rw-r--r-- | kiki.hs | 2 | ||||
-rw-r--r-- | lib/Kiki.hs | 12 |
3 files changed, 12 insertions, 12 deletions
@@ -63,11 +63,11 @@ main = do | |||
63 | (cmd,args) <- splitAt 1 <$> getArgs | 63 | (cmd,args) <- splitAt 1 <$> getArgs |
64 | uid <- getEffectiveUserID | 64 | uid <- getEffectiveUserID |
65 | let msel = case cmd of | 65 | let msel = case cmd of |
66 | ["ssh-client"] -> Just $ sshClient uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir | 66 | ["ssh-client"] -> Just $ sshClient uid <$> Kiki.opt_chroot <*> Kiki.opt_homedir |
67 | ["ssh-server"] -> Just $ sshServer uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir | 67 | ["ssh-server"] -> Just $ sshServer uid <$> Kiki.opt_chroot <*> Kiki.opt_homedir |
68 | ["strongswan"] -> Just $ strongswan uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir | 68 | ["strongswan"] -> Just $ strongswan uid <$> Kiki.opt_chroot <*> Kiki.opt_homedir |
69 | ["tor"] -> Just $ configureTor uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir | 69 | ["tor"] -> Just $ configureTor uid <$> Kiki.opt_chroot <*> Kiki.opt_homedir |
70 | ["hosts"] -> Just $ configureHosts uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir | 70 | ["hosts"] -> Just $ configureHosts uid <$> Kiki.opt_chroot <*> Kiki.opt_homedir |
71 | _ -> Nothing | 71 | _ -> Nothing |
72 | spec = uncurry fancy Kiki.kikiOptions "" | 72 | spec = uncurry fancy Kiki.kikiOptions "" |
73 | errorQuit msg = do | 73 | errorQuit msg = do |
@@ -1548,7 +1548,7 @@ kiki "init" args | "--help" `elem` args = do | |||
1548 | , "" | 1548 | , "" |
1549 | ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True | 1549 | ] ++ documentHomeDir ++ [""] ++ documentPassphraseFDFlag True True True |
1550 | 1550 | ||
1551 | kiki "init" args = run args $ importAndRefresh <$> ㄧchroot <*> ㄧhomedir <*> ㄧcipher | 1551 | kiki "init" args = run args $ importAndRefresh <$> opt_chroot <*> opt_homedir <*> opt_cipher |
1552 | 1552 | ||
1553 | kiki "delete" args | "--help" `elem` args = do | 1553 | kiki "delete" args | "--help" `elem` args = do |
1554 | putStr . unlines $ | 1554 | putStr . unlines $ |
diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 45e67f8..a683a91 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs | |||
@@ -656,16 +656,16 @@ slash "" ('/':xs) = '/':xs | |||
656 | slash "" xs = '/':xs | 656 | slash "" xs = '/':xs |
657 | slash (y:ys) xs = y:slash ys xs | 657 | slash (y:ys) xs = y:slash ys xs |
658 | 658 | ||
659 | ㄧchroot :: Args (FilePath -> FilePath) | 659 | opt_chroot :: Args (FilePath -> FilePath) |
660 | ㄧchroot = pure (\r a -> slash r a) <*> arg "--chroot" <|> pure id | 660 | opt_chroot = pure (\r a -> slash r a) <*> arg "--chroot" <|> pure id |
661 | 661 | ||
662 | ㄧhomedir :: Args CommonArgsParsed | 662 | opt_homedir :: Args CommonArgsParsed |
663 | ㄧhomedir = CommonArgsParsed | 663 | opt_homedir = CommonArgsParsed |
664 | <$> optional (arg "--homedir") | 664 | <$> optional (arg "--homedir") |
665 | <*> optional (FileDesc <$> read <$> arg "--passphrase-fd") | 665 | <*> optional (FileDesc <$> read <$> arg "--passphrase-fd") |
666 | 666 | ||
667 | ㄧcipher :: Args SymmetricAlgorithm | 667 | opt_cipher :: Args SymmetricAlgorithm |
668 | ㄧcipher = fromMaybe CAST5 <$> optional (cipherFromString <$> arg "--cipher") | 668 | opt_cipher = fromMaybe CAST5 <$> optional (cipherFromString <$> arg "--cipher") |
669 | 669 | ||
670 | kikiOptions :: ( [(String,Int)], [String] ) | 670 | kikiOptions :: ( [(String,Int)], [String] ) |
671 | kikiOptions = ( ss, ps ) | 671 | kikiOptions = ( ss, ps ) |