module Main (main) where

import Lib
import GraphConstruction
import System.Exit ( die )
import System.Environment ( getArgs )

main :: IO ()
main = do
  [filenamePrefix, start, end] <- getArgsOrDie
  graph <- readDataParallel filenamePrefix
  runBFS graph start end

getArgsOrDie :: IO [String]
getArgsOrDie = do
  args <- getArgs
  if length args == 3 then return args
  else die "Usage: stack run <graph-filename-prefix> <from-vertex> <to-vertex>"
