cli icon indicating copy to clipboard operation
cli copied to clipboard

`--log-as-json` should not be present as a flag under `dapr list`

Open philliphoff opened this issue 3 years ago • 8 comments

Expected Behavior

When running dapr list --log-as-json, I expect the output to be in JSON format.

Actual Behavior

The output is in the default table format.

Steps to Reproduce the Problem

% dapr --version
CLI version: 1.2.0-rc.2 
Runtime version: 1.2.0-rc.3

% dapr list --help
List all Dapr instances. Supported platforms: Kubernetes and self-hosted

Usage:
  dapr list [flags]

Examples:

# List Dapr instances in self-hosted mode
dapr list

# List Dapr instances in Kubernetes mode
dapr list -k


Flags:
  -h, --help         Print this help message
  -k, --kubernetes   List all Dapr pods in a Kubernetes cluster

Global Flags:
      --log-as-json   Log output in JSON format

% dapr list --log-as-json
  APP ID              HTTP PORT  GRPC PORT  APP PORT  COMMAND  AGE  CREATED              PID    
  Ninjabronze-Reaper  54536      54537      0                  4m   2021-05-25 10:36.29  28261

philliphoff avatar May 25 '21 17:05 philliphoff

@philliphoff I believe the idea was that --log-as-json was for logs from daprd and the application not a change in the output format.

cc @pkedy

mukundansundar avatar May 25 '21 17:05 mukundansundar

Sure, though in that case I'd argue that it's still a bug to show the option under the list command. :-)

That said, an "output as JSON" option for list would be helpful in allowing other tools to wrap it. For example, the VS Code extension currently has logic to extract running Dapr applications from the local process list. That's exactly what dapr list does! It'd be nice to eliminate that implementation in order reuse the Dapr CLI's implementation, but its current format makes parsing, while possible, more complicated than necessary.

philliphoff avatar May 25 '21 18:05 philliphoff

@philliphoff Can you create a separate feature request for output as JSON/YAML for dapr list ? Leaving this issue to fix the issue where --log-as-json shows up under dapr list

mukundansundar avatar May 25 '21 18:05 mukundansundar

opened a new issue listing this requirement https://github.com/dapr/cli/issues/728

mukundansundar avatar May 25 '21 18:05 mukundansundar

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

dapr-bot avatar Jan 04 '22 01:01 dapr-bot

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

dapr-bot avatar Feb 03 '22 01:02 dapr-bot

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.

dapr-bot avatar Feb 10 '22 01:02 dapr-bot

bug still present

mukundansundar avatar Feb 10 '22 02:02 mukundansundar