Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Conversation

ulyssessouza
Copy link
Contributor

Implements run part of https://github.com/docker/api/issues/54

This PR depends on the merge of https://github.com/docker/api/pull/76 to enable the test of the output of the run command

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
@ulyssessouza ulyssessouza requested a review from rumpl May 13, 2020 08:30
@ulyssessouza ulyssessouza self-assigned this May 13, 2020
@ulyssessouza ulyssessouza requested a review from gtardif May 13, 2020 08:30
if err := runRun(cmd.Context(), args[0], opts); err != nil {
return err
}
fmt.Println(opts.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why not add this code to runRun but here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not an important thing, but if we look at the runRun it can be used in anything... So I look at it as a clean function. And the output (in this case opt.name) of this is related to the command line which is cobra related code.
So I just prefer to keep the command line specific code together and keep the generic stuff out of this.

And yes, I know the intent of this function is to be used only by Command() but it looks cleaner to me like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you mean, we don't have the same interpretation of this function, for me runRun and all others is there just so that the creation of the command is cleaner and without extra code, only the declarative things go there.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just a shame that there is no unity in the commands

@rumpl rumpl merged commit 2d14bfe into docker-archive:master May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants