Added support for command-line argument to specify directory