fixed parsing of options and output of command