added cli parsing. todo: work out the followRedirect logic