Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (18 sloc) 0.904 kb
d042bcfe » Alessandro Vermeulen
2011-03-26 The first commit.
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"
7026325b » Alessandro Vermeulen
2011-03-26 Fixed some cabal + licence stuff
20 mapM_ (putStrLn) $ sort . nub . filter (isPrefixOf current_word)
d042bcfe » Alessandro Vermeulen
2011-03-26 The first commit.
21 $ map (head . words) (lines text)
22 else
23 hPutStrLn stderr "Provide a haskell file and a current word!"
24 where command file = "echo \":ctags /tmp/textmatetags\" | ghci " ++ file ++" &> /tmp/runtags"
Something went wrong with that request. Please try again.