Skip to content

Use spf13/cobra for docker search#23241

Merged
cpuguy83 merged 1 commit intomoby:masterfrom
vdemeester:migrate-search-to-cobra
Jun 4, 2016
Merged

Use spf13/cobra for docker search#23241
cpuguy83 merged 1 commit intomoby:masterfrom
vdemeester:migrate-search-to-cobra

Conversation

@vdemeester
Copy link
Copy Markdown
Member

  • Move image search command search to api/client/image/search.go
  • Use cobra 🐍.

/cc @dnephin @thaJeztah @LK4D4

🐸

Signed-off-by: Vincent Demeester [email protected]

@vdemeester
Copy link
Copy Markdown
Member Author

@dnelphin there is one weird thing though, putting [OPTIONS] … into Use make the output of help weird :

λ ./bundles/latest/dynbinary-client/docker help
# […]
    save      Save one or more images to a tar archive
    search [OPSearch the Docker Hub for images
    start     Start one or more stopped containers
# […]

but the deprecated feature, I ❤️ it :

λ ./bundles/latest/dynbinary-client/docker search --automated docker
Flag --automated has been deprecated, Use --filter=automated=true instead
NAME                                    DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
konradkleine/docker-registry-frontend   Browse and modify your Docker registry in ...   95                   [OK]
jdubois/jhipster-docker                 DO NOT USE: Former official JHipster Docke...   57                   [OK]
martin/docker-cleanup-volumes           Delete orphaned docker volumes                  47                   [OK]
datadog/docker-dd-agent                 Docker container for the Datadog Agent.         28                   [OK]

@vdemeester vdemeester force-pushed the migrate-search-to-cobra branch from 64edb32 to 756a8ad Compare June 3, 2016 16:45
@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 3, 2016

@vdemeester vdemeester force-pushed the migrate-search-to-cobra branch from 756a8ad to 193e3c4 Compare June 3, 2016 16:48
@vdemeester
Copy link
Copy Markdown
Member Author

@dnelphin perfect ! 👍

@vdemeester vdemeester force-pushed the migrate-search-to-cobra branch from 193e3c4 to d3b7b19 Compare June 3, 2016 17:21
- Move image command search to `api/client/image/search.go`
- Use cobra :)

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester force-pushed the migrate-search-to-cobra branch from d3b7b19 to a11ef10 Compare June 3, 2016 17:50
@dnephin
Copy link
Copy Markdown
Member

dnephin commented Jun 3, 2016

LGTM

Comment thread cli/required.go
return nil
}
return fmt.Errorf(
"\"%s\" requires exactly %d argument(s).\n\nUsage: %s\n\n%s",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is different from what we have now; would be nice if we have a generic function to use singular/plural here

docker: "search" requires 1 argument.

@thaJeztah
Copy link
Copy Markdown
Member

thaJeztah commented Jun 3, 2016

Funny; it treats --limit=-1 and --limit -1 different;

docker search --limit=-1 a
Error response from daemon: Limit -1 is outside the range of [1, 100]

docker search --limit -1 a
"docker search" requires exactly 1 argument(s).

Usage:  docker search [OPTIONS] TERM
...

LGTM (unless you want to update that nit 😄)

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Jun 4, 2016

LGTM, windows error is know, gcc finished but didn't notify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants