blob: 320b4269d17c205f78be0fcf2912ccf8853bcce4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
module Main (main) where
import Control.Concurrent
import Control.Monad.Trans
import System.Environment
import System.Exit
import System.IO
import Network.BitTorrent
parseArgs :: IO FilePath
parseArgs = do
args <- getArgs
case args of
[path] -> return path
_ -> do
hPutStrLn stderr "Usage: client file.torrent"
exitFailure
main :: IO ()
main = do
path <- parseArgs
torrent <- fromFile path
simpleClient $ do
h <- openTorrent "data" torrent
start h
liftIO $ threadDelay 10000000000
|