Added -o option, to allow the executed queries to be saved to a file