Skip to content

Invert flags#5760

Closed
vieux wants to merge 2 commits intomoby:masterfrom
vieux:invert_flags
Closed

Invert flags#5760
vieux wants to merge 2 commits intomoby:masterfrom
vieux:invert_flags

Conversation

@vieux
Copy link
Copy Markdown
Contributor

@vieux vieux commented May 13, 2014

Close #5545

--no-trunc=false -> --trunc=true
--no-cache=false -> --cache=true
--no-stdin=false -> --stdin=true

Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented May 13, 2014

ping @SvenDowideit @shykes

@SvenDowideit
Copy link
Copy Markdown
Contributor

much ❤️ Docs LGTM

Docker-DCO-1.1-Signed-off-by: Victor Vieux <[email protected]> (github: vieux)
@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented May 13, 2014

@tianon typo updated

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented May 14, 2014

ping @shykes @crosbymichael @creack

@creack
Copy link
Copy Markdown
Contributor

creack commented May 14, 2014

Hmm, why? It is pretty painful to write --flag=false whereas --no-flag is straight forward and pretty.

@vieux
Copy link
Copy Markdown
Contributor Author

vieux commented May 14, 2014

@creack see #5545, @SvenDowideit is confused by --no-flag=false

@creack
Copy link
Copy Markdown
Contributor

creack commented May 14, 2014

This is a conflict between documentation and usability. Having to manually specify the value to the flag really makes usability worse. --no-flag is binary, either it is present either it is not. You don't need to worry about its value, so there is no double negative.
ping @SvenDowideit

@tianon
Copy link
Copy Markdown
Member

tianon commented May 14, 2014

With #5764 that I did on top of this one, using --no-trunc is effectively shorthand for --trunc=false, but --no-trunc=false literally won't parse (ie, if the flag we're parsing has a value attached via =, we don't even check whether it's got the -no prefix).

@SvenDowideit
Copy link
Copy Markdown
Contributor

@vieux and @creack yes - the confusion I'm talking about is in how the help for the option is laid out, not so much the actual usage.

Specifically, read -D, --debug, --no-debug (=false) Enable debug mode and notice that it does infact tell the reader that --no-debug (=false) is something. While someone that knows Docker will realise that you're saying that the default is --debug=false or --no-debug that's not what is written.

Its even more amusing, given that if someone reads the entire line as a single sentence, it becomes very true again - IFF you ignore the braces:

Using -D, --debug or --no-debug=false will enable debug mode.

@tianon
Copy link
Copy Markdown
Member

tianon commented May 14, 2014

I agree - that fugly syntax was my first-pass attempt to show whether we're enabled or disabled by default. I think swapping that to (default: enabled) or (default: disabled) would help (which would be reasonably simple to do).

@shykes
Copy link
Copy Markdown
Contributor

shykes commented May 16, 2014

The motivation seems to be to solve #5545. However that issue is really about clarity of the usage message,
not syntax of the flag itself.

Since breaking a flag is always extra work and complication, we should only do it if there's a strong
enough reason. I don't think there's a very strong reason in this case. It seems to me we could
just fix the usage message to not print '=false' and we should be good.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker ps -h: --no-trunc incorrectly documented

5 participants