command line tapquery
allow tapquery to print to stdout if --out is not given
clean up tapquery