added command line option --dir to specify the start-in directry