Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 27 lines (18 sloc) 0.962 kb
d042bcf The first commit.
Alessandro Vermeulen authored
1 module Main where
2
3 -- import Control.Monad ( (<<) )
4
5 import System( getArgs )
6 import System.IO( stderr, hPutStrLn )
7
8 import System.Process( runCommand, waitForProcess)
9
10 import Data.List( nub, sort, isPrefixOf )
11
12 main = do args <- getArgs
13 if (length args >= 2) then
14 do let file = head args
15 let current_word = (head . tail) args
16 procHandle <- runCommand $ command file
17 exitcode <- waitForProcess procHandle
18
19 text <- readFile "/tmp/textmatetags"
20 mapM_ (putStrLn) $ sort . nub -- . filter (isPrefixOf current_word)
21 $ map (head . words) (lines text)
22
23
24 else
25 hPutStrLn stderr "Provide a haskell file and a current word!"
26 where command file = "echo \":ctags /tmp/textmatetags\" | ghci " ++ file ++" &> /tmp/runtags"
Something went wrong with that request. Please try again.