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

tag ls: print informational messages on STDERR #156

Open
thaJeztah opened this issue Jan 6, 2021 · 0 comments
Open

tag ls: print informational messages on STDERR #156

thaJeztah opened this issue Jan 6, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@thaJeztah
Copy link
Member

Description

Steps to reproduce the issue:

$ hub-tool tag ls nginx 1> /dev/null
# no output
$ hub-tool tag ls nginx 2> /dev/null

TAG                           DIGEST                                                                     STATUS    LAST UPDATE      LAST PUSHED    LAST PULLED       SIZE
nginx:latest                  sha256:f19d295b57fdde6f71573f487b35875ca95bd23401b142eb55eeb9d887f9f5b1    active    3 weeks ago      3 weeks        17 minutes        421.2MB
nginx:stable-alpine-perl      sha256:0c85226446a083d92fbf432faee51d12933eafdcf13eb0b7d06fc465368ae908    active    2 weeks ago      2 weeks        52 minutes        124.8MB
nginx:stable-alpine           sha256:da3716611fb965f3fda1f3281882baeb2760ca8bb7317f1d22ed45e75570827b    active    2 weeks ago      2 weeks        19 minutes        64.99MB
nginx:mainline-alpine-perl    sha256:65f87cf0859fc1de79c1346ce9b7b7ecb4abb6042339a6b696fc08309453d74c    active    2 weeks ago      2 weeks        25 minutes        126.3MB
...
nginx:1.17.4                  sha256:853d4bc0c7b54167df8954c47038d55117d3f37a70afc5871f0a5b4fdcc88f9c    active    14 months ago    14 months      4 minutes         301.3MB
nginx:1.17.3-perl             sha256:0546d4e0e8d3be6edd813bcd44c768b322f6391a52181a0ab9fb302656ebe994    active    16 months ago    16 months      6 minutes         365.9MB
nginx:1.17.3                  sha256:01c59d844f52aad434414cb7fa5bbc97545c4e6ab4ddd71fbe576a8c30c351a9    active    16 months ago    16 months      7 minutes         301.2MB
nginx:1.17.3-alpine-perl      sha256:79d35becd1e08c637d828ffbc6c7252eddf1133d2beea8b158239ff82e63c520    active    16 months ago    16 months      8 minutes         105.4MB
nginx:1.17.3-alpine           sha256:8ebb6a60c8cff4db996e987b4a3b1a5842411b7953f326186ef60566eb314b50    active    16 months ago    16 months      9 minutes         52.31MB
100/325 listed, use --all flag to show all

Describe the results you received:

The informational 100/325 listed, use --all flag to show all message is printed on STDOUT.

Describe the results you expected:

The informational 100/325 listed, use --all flag to show all message should be printed on STDERR, so that users can pipe the output to other tools for scripting/processing, e.g.:

$ hub-tool tag ls nginx | awk -F' ' '{print $2}'
DIGEST
sha256:f19d295b57fdde6f71573f487b35875ca95bd23401b142eb55eeb9d887f9f5b1
...
sha256:79d35becd1e08c637d828ffbc6c7252eddf1133d2beea8b158239ff82e63c520
sha256:8ebb6a60c8cff4db996e987b4a3b1a5842411b7953f326186ef60566eb314b50
listed,

Currently, this requires the user to strip the last line, otherwise the informational message is included (see above);

$ hub-tool tag ls nginx | head -n 101 | awk -F' ' '{print $2}'

DIGEST
sha256:f19d295b57fdde6f71573f487b35875ca95bd23401b142eb55eeb9d887f9f5b1
...
sha256:79d35becd1e08c637d828ffbc6c7252eddf1133d2beea8b158239ff82e63c520
sha256:8ebb6a60c8cff4db996e987b4a3b1a5842411b7953f326186ef60566eb314b50

Output of docker hub --version:

hub-tool --version
Docker Hub Tool v0.2.0, build 0edf43a
@thaJeztah thaJeztah added the enhancement New feature or request label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant