Fix compile flags on MSVC and argument handling

Argument handling now checks for indexOf returning -1 because no --dir
option was found.