Skip to content

Conversation

@vieux
Copy link
Contributor

@vieux vieux commented Nov 3, 2016

another solution to fix #28008

right now it uses names, any better idea ?

ping @dnephin @mlaventure @icecrime

Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to add a property to these commands / flags so that we can show/hide based on that property?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we can do that in our fork of cobra (I suggested that for the other option as well #28008 (comment)).

So it sounds like either option would benefit from this.

@icecrime
Copy link
Contributor

icecrime commented Nov 3, 2016

Can you explain how it differs from the other solution?

@vieux
Copy link
Contributor Author

vieux commented Nov 3, 2016

In this solution, the commands are added, parsed and then hidden.
the usage looks cleaner, but it also mean you can do docker deploy --help and it's going to work even if docker --help doesn't show the deploy command.

In the other solution, commands are always displayed.

@vieux
Copy link
Contributor Author

vieux commented Nov 3, 2016

@icecrime ^

Signed-off-by: Victor Vieux <vieux@docker.com>
@vieux vieux force-pushed the fix_experimental_client branch 4 times, most recently from db6cccb to db82561 Compare November 4, 2016 01:10
@vieux
Copy link
Contributor Author

vieux commented Nov 4, 2016

@dnephin @vdemeester @thaJeztah PTAL I believe it's now more clean and ready to be merged.

@vieux vieux force-pushed the fix_experimental_client branch from 5e088e7 to 77467c4 Compare November 4, 2016 01:46
@vieux
Copy link
Contributor Author

vieux commented Nov 4, 2016

rebased with the vndr change (<3 @LK4D4)

Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

small nit, but LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd rather have this just after the flag it affects

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

One small nit, otherwise LGTM

Copy link
Member

Choose a reason for hiding this comment

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

This is now called from only one place, after initializing the client. Maybe we could remove HasExperimental() and instead just call Ping() directly?

I think it would still be only a single function call. The rest of this code is just for managing state, and we don't need the state if we're only looking at it once.

Copy link
Member

@dnephin dnephin Nov 4, 2016

Choose a reason for hiding this comment

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

Alternatively, we could keep HasExperimental() but make it only return the boolean, and not store anything. So we could still remove hasExperimental

Signed-off-by: Victor Vieux <vieux@docker.com>
@vieux vieux force-pushed the fix_experimental_client branch from 77467c4 to d34ca01 Compare November 4, 2016 19:04
@vieux
Copy link
Contributor Author

vieux commented Nov 4, 2016

@dnephin @mlaventure I addressed both of your comments.

@mlaventure
Copy link
Contributor

LGTM

@vieux vieux merged commit f6edbdf into moby:master Nov 4, 2016
@vieux vieux deleted the fix_experimental_client branch November 4, 2016 20:49
@thaJeztah thaJeztah added this to the 1.13.0 milestone Nov 4, 2016
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
always add but hide experimental cmds and flags
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.

6 participants