aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ShellPrompt.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ShellPrompt.hs b/ShellPrompt.hs
index dfa77d0..a2f6465 100644
--- a/ShellPrompt.hs
+++ b/ShellPrompt.hs
@@ -16,6 +16,8 @@ module XMonadContrib.ShellPrompt (
-- * Usage
-- $usage
shellPrompt
+ , rmPath
+ , split
) where
import XMonad
@@ -73,8 +75,10 @@ commandCompletionFunction str
cl = liftM (nub . rmPath . concat) . mapM fCF . map addToPath . split ':'
addToPath = flip (++) ("/" ++ str)
fCF = filenameCompletionFunction
- rmPath [] = []
- rmPath s = map (last . split '/') s
+
+rmPath :: [String] -> [String]
+rmPath s =
+ map (reverse . fst . break (=='/') . reverse) s
split :: Eq a => a -> [a] -> [[a]]
split _ [] = []