1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

23 commits

Author SHA1 Message Date
Michal Minar
8a785792cd Exit with non-zero code on first argument parsing error
Ignoring return value of ParseFlags leads to exit code 0 if bad
arguments are supplied. This patch makes sure that subcommands exit
with non-zero code in such a case.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-01-06 13:46:38 +01:00
Dan Walsh
a2b529ead2 --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

    QE teams have requested this change, also users doing docker help | less
    or docker run --help | less would expect this to work.

    Usage statement should only be printed when the user asks for it.
    Errors should print error message and then suggest the docker COMMAND --help
    command to see usage information.

    The current behaviour causes the user to have to search for the error message
    and sometimes scrolls right off the screen.  For example a error on a
    "docker run" command is very difficult to diagnose.

    Finally erros should always exit with a non 0 exit code, if the user
    makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-01-06 13:40:14 +01:00
Arnaud Porterie
67e3ddb75f Forbid client piping to tty enabled container
Forbid `docker run -t` with a redirected stdin (such as `echo test |
docker run -ti busybox cat`). Forbid `docker exec -t` with a redirected
stdin. Forbid `docker attach` with a redirect stdin toward a tty enabled
container.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-09 14:30:49 -08:00
Victor Vieux
454f56e37e use _, _ string
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-14 19:31:52 +00:00
Victor Vieux
5fbfec333a update timeout
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-13 03:21:18 +00:00
Victor Vieux
6ca144ef3d fix unix socket
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-12 00:37:58 +00:00
Victor Vieux
4b4ad26b97 handle GET redirects
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-12 00:37:58 +00:00
Ben Firshman
ef004ec03f Fix help text being incorrect with multiple args
E.g. "docker foobar run" would have printed "Command not found:
foobar" and printed the help text for "run". It should instead
print the root help message for docker.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2014-11-03 16:46:01 +00:00
Vincent Batts
da42ae536c client: even cleaner use of Transport
First off, sorry for the noise. This is a cleaner step of #8508

Found more of a root cause of the open file handles.
After more testing I found that the open file descriptors will still
occur for TCP:// connections to the daemon, causing client and/or daemon
to fail.

The issue was instantiating a new http.Transport on _ever_ client
request. So each instance held the prior connection alive, but was only
ever used once.

By moving it out to the initilization of DockerCli, we can now have
reuse of idled connections. Simplifies the garbage overhead of the
client too, though that's not usually a deal.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-10-12 22:32:55 -04:00
Derek McGowan
ea6a480128 Add libtrust key identity management
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-09-26 15:52:08 -07:00
Vojtech Vitek (V-Teq)
d742c57f53 DockerCli: Check IsTerminal() for both STDIN and STDOUT
`docker events > /tmp/out` should not print control
characters to non-terminal STDOUT.

This addresses commit 26b4a4920a
without creating regression described in issue #6509.

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-25 20:58:24 +02:00
Vojtech Vitek (V-Teq)
40c7b53791 Fix #6509: Interactive container hangs when redirecting stdout
Cli IsTerminal() SYS_IOCTL operation should be determined from STDIN,
not from STDOUT.

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-25 20:14:25 +02:00
Ben Firshman
e1b968f198 Add support for multiple level CLI commands
E.g. "docker groups create" will attempt to call the function
CmdGroupsCreate

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2014-09-19 10:43:50 -07:00
SvenDowideit
8c6c4a12b7 add the [OPTIONS] string automatically if there are flags defined
Signed-off-by: SvenDowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-08-28 08:50:50 +10:00
Victor Vieux
2e489073d9 Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d818.

Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-27 18:59:13 +00:00
Dan Walsh
61b129d818 --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-08-21 15:35:20 -04:00
Solomon Hykes
a110ce2f28 Rename a method for clarity
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-10 04:33:19 +00:00
Solomon Hykes
5e9b3727b8 Move declaration of DockerCli to top of file for readability
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-10 04:31:59 +00:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
Dan Walsh
26b4a4920a This check was backwards.
If I do a

docker events  > /tmp/out

I do not want the control characters getting written to the file.
The check should check the output file not the input file.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-05-21 17:37:40 -04:00
Dan Walsh
bc081a03d8 docker '' causes a golang crash.
This patch fixes the problem.

Docker-DCO-1.1-Signed-off-by: Daniel Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-05-20 14:04:27 -04:00
Victor Vieux
45be6f6dff fix https
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-02 19:49:12 +00:00
Victor Vieux
ae9ed84fda split client in 2 files
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-31 18:11:53 +00:00