-- command line arguments, hostanme, drive letter to use while mapping, file to read without drive letter
go :: [String] -> IO ()
go [host, share, drive, fileName] = do --(host:(share:(drive:(fileName:[]))))
  _ <- cleanup drive
  x1 <- timeCommand "cmd" ["/c net use " ++ drive ++ " \\\\" ++ host ++ "\\" ++ share]
  --print x1
  let r1 = toCommandResult x1 "Map Share"
  if isError r1 then
    TLIO.putStr $ makeError r1
  else do
    x2 <- timeCommand "cmd" ["/c dir " ++ drive]
    --print x2
    let r2 = toCommandResult x2 "List Dir"
    if isError r2 then
      TLIO.putStr $ makeError r2
    else do
      x3 <- timeCommand "cmd" ["/c type " ++ drive ++ "\\" ++ fileName]
      --print x3
      let r3 = toCommandResult x3 "Read File"
      if isError r3 then
        TLIO.putStr $ makeError r3
      else
        TLIO.putStr $ makeResults [r1,r2,r3]
    _ <- cleanup drive
    return ()
go :: [String] -> IO ()
go [host, share, drive, fileName] = do --(host:(share:(drive:(fileName:[]))))
  _ <- cleanup drive
  x1 <- timeCommand "cmd" ["/c net use " ++ drive ++ " \\\\" ++ host ++ "\\" ++ share]
  --print x1
  let r1 = toCommandResult x1 "Map Share"
  if isError r1 then
    TLIO.putStr $ makeError r1
  else do
    x2 <- timeCommand "cmd" ["/c dir " ++ drive]
    --print x2
    let r2 = toCommandResult x2 "List Dir"
    if isError r2 then
      TLIO.putStr $ makeError r2
    else do
      x3 <- timeCommand "cmd" ["/c type " ++ drive ++ "\\" ++ fileName]
      --print x3
      let r3 = toCommandResult x3 "Read File"
      if isError r3 then
        TLIO.putStr $ makeError r3
      else
        TLIO.putStr $ makeResults [r1,r2,r3]
    _ <- cleanup drive
    return ()
go [host, share, drive, fileName] = do --(host:(share:(drive:(fileName:[]))))
  _ <- cleanup drive
  x1 <- timeCommand "cmd" ["/c net use " ++ drive ++ " \\\\" ++ host ++ "\\" ++ share]
  --print x1
  let r1 = toCommandResult x1 "Map Share"
  if isError r1 then
    TLIO.putStr $ makeError r1
  else do
    x2 <- timeCommand "cmd" ["/c dir " ++ drive]
    --print x2
    let r2 = toCommandResult x2 "List Dir"
    if isError r2 then
      TLIO.putStr $ makeError r2
    else do
      x3 <- timeCommand "cmd" ["/c type " ++ drive ++ "\\" ++ fileName]
      --print x3
      let r3 = toCommandResult x3 "Read File"
      if isError r3 then
        TLIO.putStr $ makeError r3
      else
        TLIO.putStr $ makeResults [r1,r2,r3]
    _ <- cleanup drive
    return ()