docker / docker/cli

Proposal: Consistent inspect/output from CLI

Open
#522 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/swarm area/ux kind/enhancement version/17.09
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

When going through the different cli commands, the output tends to differ based on the command being used.
Although this has been there for ever, it'd be great to standardize it and allow more flexibility.

Steps to reproduce the issue:

  1. Get docker up and running
  2. Check docker info - notice the 'pretty print'. How do you get that in a JSON format?
  3. Check docker node inspect self - notice the jSON output. But you do have the option to --pretty print.

Describe the results you received:
All outputs are different based on the command that you're executing

Describe the results you expected:
I expect all of my outputs to be in JSON or pretty-print format. I also expect all commands to support the --pretty flag in order to get a cleaner output.
For example, inspecting a container, gives a JSON output, but there is no --pretty support:

$ docker container inspect 1c0 --pretty
unknown flag: --pretty

Additional information you deem important (e.g. issue happens only occasionally):
This has been in the CLI for ever and isn't a huge deal, more of an annoyance.

Output of docker version:

$ docker version
Client:
 Version:      17.09.0-ce-rc1
 API version:  1.31
 Go version:   go1.8.3
 Git commit:   ae21824
 Built:        Wed Sep  6 22:25:36 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.09.0-ce-rc1
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   ae21824
 Built:        Wed Sep  6 22:31:19 2017
 OS/Arch:      linux/amd64
 Experimental: true

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the output and available flags for docker info, docker node inspect self, and docker container inspect. Define the desired JSON and pretty-print behavior, including consistent --pretty support, before locating the affected CLI commands and deciding how completion will be tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.