diff options
author | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-24 16:41:28 +0200 |
---|---|---|
committer | Valery V. Vorotyntsev <valery.vv@gmail.com> | 2007-10-24 16:41:28 +0200 |
commit | bd32dc8e402cef84d49ae7f7938c9061f9f415f5 (patch) | |
tree | 1e13852ce30b9247e759541b8bd1669209b43ec7 | |
parent | 489084a420f7d7c22a3d9414e696b4c0976cf7bb (diff) | |
download | XMonadContrib-bd32dc8e402cef84d49ae7f7938c9061f9f415f5.tar.gz XMonadContrib-bd32dc8e402cef84d49ae7f7938c9061f9f415f5.tar.xz XMonadContrib-bd32dc8e402cef84d49ae7f7938c9061f9f415f5.zip |
SshPrompt.hs: use `uniqSort' from XPrompt.hs
Remove excessive import lists.
darcs-hash:20071024144128-ae588-bd38d60a520621b2bbb318f8a2ae748131b93903.gz
-rw-r--r-- | SshPrompt.hs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/SshPrompt.hs b/SshPrompt.hs index 05345ec..64dd5ef 100644 --- a/SshPrompt.hs +++ b/SshPrompt.hs @@ -3,7 +3,7 @@ -- Module : XMonadContrib.SshPrompt -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 --- +-- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : unportable @@ -18,17 +18,17 @@ module XMonadContrib.SshPrompt ( sshPrompt ) where -import System.Environment (getEnv) -import Control.Monad(Monad (return), Functor(..), liftM2, mapM) -import Data.List ((++), concat, filter, map, words, lines, takeWhile, take, - sort) -import Data.Maybe (Maybe(..), catMaybes) -import Data.Set (toList, fromList) -import System.Directory (doesFileExist) -import XMonad (X, io) -import XMonadContrib.Run (runInTerm) -import XMonadContrib.XPrompt (XPrompt(..), XPConfig, mkXPrompt, - mkComplFunFromList) +import XMonad +import XMonadContrib.Run +import XMonadContrib.XPrompt + +import System.Directory +import System.Environment + +import Control.Monad +import Data.List +import Data.Maybe + -- $usage -- 1. In Config.hs add: -- @@ -58,13 +58,13 @@ ssh :: String -> X () ssh s = runInTerm ("ssh " ++ s) sshComplList :: IO [String] -sshComplList = (nub . sort) `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal +sshComplList = uniqSort `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal sshComplListLocal :: IO [String] sshComplListLocal = do h <- getEnv "HOME" sshComplListFile $ h ++ "/.ssh/known_hosts" - + sshComplListGlobal :: IO [String] sshComplListGlobal = do env <- getEnv "SSH_KNOWN_HOSTS" `catch` (\_ -> return "/nonexistent") |