dotcloud/docker — pull request #5764 by tianon (2014-05-13 04:12:55+00:00)
Title: Add support for --no-* versions of boolean flags directly in mflag itself

So, this is building upon #5760 just to better illustrate what I was trying to describe in #5545.

I don't necessarily expect it to be merged, but figured it wouldn't hurt to actually implement it just to show exactly what it is that I mean.

Basically, for boolean flags, this deprecates the `--flag=true|false` syntax (while still supporting it, but only for non-`--no-*` versions to keep it simple and easy).

Here's some example output:
```console
$ ./bundles/0.11.1-dev/dynbinary/docker --help
Usage of ./bundles/0.11.1-dev/dynbinary/docker:
--api-enable-cors, --no-api-enable-cors (=false) Enable CORS headers in the remote API
-b, --bridge="" Attach containers to a pre-existing network bridge
use 'none' to disable container networking
--bip="" Use this CIDR notation address for the network bridge's IP, not compatible with -b
-d, --daemon, --no-daemon (=false) Enable daemon mode
-D, --debug, --no-debug (=false) Enable debug mode
--dns=[] Force docker to use specific DNS servers
--dns-search=[] Force Docker to use specific DNS search domains
-e, --exec-driver="native" Force the docker runtime to use a specific exec driver
-g, --graph="/var/lib/docker" Path to use as the root of the docker runtime
-G, --group="docker" Group to assign the unix socket specified by -H when running in daemon mode
use '' (the empty string) to disable setting of a group
-H, --host=[] The socket(s) to bind to in daemon mode
specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.
--icc, --no-icc (=true) Enable inter-container communication
--ip="0.0.0.0" Default IP address to use when binding container ports
--ip-forward, --no-ip-forward (=true) Enable net.ipv4.ip_forward
--iptables, --no-iptables (=true) Enable Docker's addition of iptables rules
--mtu=0 Set the containers network MTU
if no value is provided: default to the default route MTU or 1500 if no default route is available
-p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file
-r, --restart, --no-restart (=true) Restart previously running containers
-s, --storage-driver="" Force the docker runtime to use a specific storage driver
--selinux-enabled, --no-selinux-enabled (=false) Enable selinux support
--tls, --no-tls (=false) Use TLS; implied by tls-verify flags
--tlscacert="/home/tianon/.docker/ca.pem" Trust only remotes providing a certificate signed by the CA given here
--tlscert="/home/tianon/.docker/cert.pem" Path to TLS certificate file
--tlskey="/home/tianon/.docker/key.pem" Path to TLS key file
--tlsverify, --no-tlsverify (=false) Use TLS and verify the remote (daemon: verify client, client: verify daemon)
-v, --version, --no-version (=false) Print version information and quit
$ ./bundles/0.11.1-dev/dynbinary/docker run --help

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

-a, --attach=[] Attach to stdin, stdout or stderr.
-c, --cpu-shares=0 CPU shares (relative weight)
--cidfile="" Write the container ID to the file
-d, --detach, --no-detach (=false) Detached mode: Run container in the background, print new container id
--dns=[] Set custom dns servers
--dns-search=[] Set custom dns search domains
-e, --env=[] Set environment variables
--entrypoint="" Overwrite the default entrypoint of the image
--env-file=[] Read in a line delimited file of ENV variables
--expose=[] Expose a port from the container without publishing it to your host
-h, --hostname="" Container host name
-i, --interactive, --no-interactive (=false) Keep stdin open even if not attached
--link=[] Add link to another container (name:alias)
--lxc-conf=[] (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
-m, --memory="" Memory limit (format: , where unit = b, k, m or g)
--name="" Assign a name to the container
--net="bridge" Set the Network mode for the container
'bridge': creates a new network stack for the container on the docker bridge
'none': no networking for this container
'container:': reuses another container network stack
'host': use the host network stack inside the contaner
-p, --publish=[] Publish a container's port to the host
format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort
(use 'docker port' to see the actual mapping)
-P, --publish-all, --no-publish-all (=false) Publish all exposed ports to the host interfaces
--privileged, --no-privileged (=false) Give extended privileges to this container
--rm, --no-rm (=false) Automatically remove the container when it exits (incompatible with -d)
--sig-proxy, --no-sig-proxy (=true) Proxify all received signal to the process (even in non-tty mode)
-t, --tty, --no-tty (=false) Allocate a pseudo-tty
-u, --user="" Username or UID
-v, --volume=[] Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)
--volumes-from=[] Mount volumes from the specified container(s)
-w, --workdir="" Working directory inside the container
```

Again, this mostly just here to clarify my thoughts, so I won't be sad if it doesn't get reviewed and tweaked if it's unpopular. :)