Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List format prints extra newlines/whitespace; behaves oddly with --query. #134

Closed
binderjoe opened this issue Apr 20, 2016 · 4 comments
Closed

Comments

@binderjoe
Copy link

binderjoe commented Apr 20, 2016

Like --output tsv, the default list format needs to suppress extraneous newlines. If you use:
$> az vm list-all --query "[].name"
You will see
[vm]

[vm]

[vm]

$>

The output should be:

$> az vm list-all --query "[].name"
[vm]
[vm]
[vm]
$>

@yugangw-msft
Copy link
Contributor

yugangw-msft commented Apr 21, 2016

For now, this is by-design, I think. The default format is list, which by default apply a line break after each entity

@yugangw-msft
Copy link
Contributor

It appears, the query doesn't really work very with the "list" format, particularly when you use it to reduce the output and pipe to the next command. IMO, default to json makes more sense

@yugangw-msft
Copy link
Contributor

Also, the "list" format will normalize the field name to be Pascal style, say from 'name' to 'Name', so you can't use it for projection.

@tjprescott
Copy link
Member

I checked the status on this today. Running az vm listl --query "[].name" yields:

[
  "vm",
  "vm",
  "vm"
]

It seems this issue is fixed.

jiasli added a commit to jiasli/azure-cli that referenced this issue Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants