From ae4fa8395e6c87a81681a44b549b8cbbfe82e5e1 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 25 Apr 2016 23:36:21 -0400 Subject: slash utility (for gluing file paths). --- cokiki.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'cokiki.hs') diff --git a/cokiki.hs b/cokiki.hs index 8874625..055be9b 100644 --- a/cokiki.hs +++ b/cokiki.hs @@ -29,15 +29,6 @@ usage = unlines , " strongswan: TODO" ] -ㄧchroot :: Args (FilePath -> FilePath) -ㄧchroot = pure (\r a -> slash r a) <*> arg "--chroot" <|> pure id - where - slash :: String -> String -> String - slash "/" ('/':xs) = '/':xs - slash "" ('/':xs) = '/':xs - slash "" xs = '/':xs - slash (y:ys) xs = y:slash ys xs - main = do (cmd,args) <- splitAt 1 <$> getArgs uid <- getEffectiveUserID @@ -45,7 +36,7 @@ main = do | uid==0 = action | otherwise = hPutStrLn stderr "operation requires root." let sel = case cmd of - ["ssh-client"] -> pure (sshClient uid) <*> ㄧchroot <*> Kiki.ㄧhomedir + ["ssh-client"] -> pure (sshClient uid) <*> Kiki.ㄧchroot <*> Kiki.ㄧhomedir ["ssh-server"] -> pure (whenRoot sshServer) ["strongswan"] -> pure (whenRoot strongswan) _ -> pure $ hPutStr stderr usage -- cgit v1.2.3