Two changes in this PR: * Add a --log-dir command line parameter and fix command line parsing * Fix command line parsing where arguments with parameter were parsed incorrectly