zalando-zmon / zmon-cli

ZMON Command Line Interface
http://zmon.readthedocs.org/en/latest/developer/zmon-cli.html
Other
9 stars 9 forks source link

--output json not applied as shown in help #55

Closed vetinari closed 6 years ago

vetinari commented 7 years ago

A zmon entities --output json filter key value renders as text, while zmon entities filter --output json key value correctly returns json. According to the help, it should work in both positions:

$ zmon entities filter --help
Usage: zmon entities filter [OPTIONS] KEY VALUE

  List entities filtered by a certain key

Options:
  -o, --output [text|json|yaml]  Use alternative output format
  --pretty                       Pretty print JSON output. Ignored if output
                                 format is not JSON
  -h, --help                     Show this message and exit.
$ zmon entities --help
Usage: zmon entities [OPTIONS] COMMAND [ARGS]...

  Manage entities

Options:
  -o, --output [text|json|yaml]  Use alternative output format
  --pretty                       Pretty print JSON output. Ignored if output
                                 format is not JSON
  -h, --help                     Show this message and exit.

Commands:
  delete  Delete a single entity by ID
  filter  List entities filtered by a certain key
  get     Get a single entity by ID
  push    Push one or more entities
mohabusama commented 6 years ago

zmon entities acts as zmon entities list which is why it takes --output flag. In case entities filter the --output flag applies to filter and not entities, this is why it should come at the end.

Removing entities implicit list could break existing tooling.