Commit Graph

696 Commits

Author SHA1 Message Date
Lei Jitang 3ca275df6d Add `-u|--user` flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:06:54 +00:00
Lei Jitang 26c3652d5e Add some missing option to bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:06:53 +00:00
Harald Albers d0fefccd8d Add missing filters to bash completion for docker images and docker ps
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:52 +00:00
Harald Albers 4d5758b252 Do not complete --cgroup-parent as _filedir
This is a follow-up on PR 11708, as suggested by tianon.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:52 +00:00
Lei Jitang 984a0d8dee Add some run option to bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:06:52 +00:00
Vincent Batts 1bca003519 .: remove trailing white spaces
blame tibor this one ;-)
```
find . -type f -not -name '*.png' -not -name '*.go' -not -name '*.md'
-not -name '*.tar' -not -name '*.pem' -not -path './vendor/*' -not -path
'./.git/*' -not -path '*/testdata/*' -not -path './docs/*images*' -not
-path '*/testfiles/*' -not -path './bundles/*' -not -path
'./docs/*static*/*' -not -path './docs/*article-img/*' -exec grep -HnEl
'[[:space:]]$' {} \; | xargs sed -iE 's/[[:space:]]*$//'
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2017-06-02 00:06:51 +00:00
Tibor Vass 3574eda4c1 Revert "Dealing with trailing whitespaces"
The validation script from #10681 is too pedantic, and does not handle
well situations like:

```
cat <<EOF   # or <<-EOF
	Whether the leading whitespace is stripped out or not by bash
	it should still be considered as valid.
EOF
```

This reverts commit 4e65c1c319afffc325853b88c9aef0c42ec83482.

Signed-off-by: Tibor Vass <tibor@docker.com>
2017-06-02 00:06:51 +00:00
André Martins 1f934f1094 Dealing with trailing whitespaces
Created a validation that detects all trailing whitespaces from every
text file that isn't *.go, *.md, vendor/*,
docs/theme/mkdocs/tipuesearch*

Removed trailing whitespaces from every text file except from vendor/*
builder/parser/testfiles*, docs/theme/mkdocs/tipuesearch* and *.md

Signed-off-by: André Martins <martins@noironetworks.com>
2017-06-02 00:06:51 +00:00
Harald Albers fc2a7eea91 restrict bash completion for hostdir arg to directories
The previous state assumed that the HOSTPATH argument referred to a
file. As clarified by moxiegirl in PR #11305, it is a directory.
Adjusted completion to reflect this.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:51 +00:00
Harald Albers e2b5fc47e3 Updates to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:50 +00:00
Mabin 0be893a352 docs: api-enable-cors is deprecated,updated docs description
Signed-off-by: Mabin <bin.ma@huawei.com>
2017-06-02 00:06:49 +00:00
Dan Walsh e75c4494ed Need to support new linux capability AUDIT_READ
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2017-06-02 00:06:49 +00:00
Lei Jitang d8c4619844 Add --ulimit and --default-ulimit to bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:06:49 +00:00
Harald Albers 9690067dee Add bash completion for docker events --filter and --until.
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:49 +00:00
Lei Jitang 5bc113a640 Fix docker build and docker run bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2017-06-02 00:06:48 +00:00
Mike Dillon ceee2175bd Add bash completion for `docker rename`
Signed-off-by: Mike Dillon <mike@embody.org>
2017-06-02 00:06:47 +00:00
Harald Albers 3bb3eae782 Fix bash completion for docker run -d
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:47 +00:00
Harald Albers 063a4f574a Bash completion for docker kill
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:46 +00:00
Jessica Frazelle e6158378b5 Add completion for stats.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2017-06-02 00:06:46 +00:00
Harald Albers 0dafe480ab Add bash completions for daemon flags, simplify with extglob
Implementing the deamon flags the traditional way introduced even more
redundancy than usual because the same list of options with flags
had to be added twice.

This can be avoided by using variables in the case statements when
using the extglob shell option.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:46 +00:00
Harald Albers 3fb5792b25 Sort options in bash completion alphabetically
This introduces a sort order for options:

Arrange options sorted alphabetically by long name with the short
options immediately following their corresponding long form.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:44 +00:00
Harald Albers 1d3be0eae9 Add missing options to bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:44 +00:00
Harald Albers ce7267e597 Refactor completion for docker run and docker create
_docker_run and _docker_create had only one differing line.

This refactoring features:

- direct completion for both commands to the same function
- factor out the common arguments, sort & format them nicely
- compute the argument for _docker_pos_first_nonflag.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:43 +00:00
Harald Albers 3addb4d642 Minor bash completion cleanup
The -n and --networking options were removed because they are
unsupported. 
Bash completion should not reveal the existence of otherwise
undocumented unsupported options.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:42 +00:00
Harald Albers 055b224c90 Add missing options to bash completion for the run and create commands
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:42 +00:00
Harald Albers f1a49f2560 Fix support for --env-file in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-02 00:06:37 +00:00
Tianon Gravi f071599471 Optimize the bash completion even further
The biggest/bestest change here is cutting down on the number of calls to Docker in the filtering helpers (`__docker_containers_running`, etc), especially calls to the really heavy `docker images`.

Signed-off-by: Andrew Page <admwiggin@gmail.com>
2017-06-02 00:06:36 +00:00
Michael Scharf e775b26a78 add bash completion support for pause and unpause
Signed-off-by: Michael Scharf <github@scharf.gr>
2017-06-02 00:06:36 +00:00
Dan Walsh 5619082f2b Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2017-06-02 00:06:35 +00:00
Tibor Vass 442ac2bc31 Add create to contrib/completion
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2017-06-02 00:06:34 +00:00
Jessica Frazelle 98c2ff06ed Add exec to autocompletions
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2017-06-02 00:06:34 +00:00
Thomas LÉVEIL 0678d92b26 Add --force-rm to docker build command completion
Signed-off-by: Thomas LEVEIL <thomasleveil@gmail.com>
2017-06-02 00:06:33 +00:00
Tianon Gravi bfc4403d5f Update bash completion for "docker run --link" and "docker run -v" to complete on running containers and the local filesystem respectively
Also, add completion for "docker run -a" ("stdin", "stdout", and "stderr"), "docker run --env-file" (local filesystem), and some other minor code style tweaks.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:31 +00:00
Tianon Gravi 9bb81450d9 Update bash completion to only complete on directories as the argument to "docker build"
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:31 +00:00
Tianon Gravi a744ade2a8 Add bash completion for "docker rm -f" and complete on all containers instead of just stopped containers when "-f" is specified
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:30 +00:00
Tianon Gravi f66535d618 Update bash-completion to reflect ability to push single tags
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:29 +00:00
Victor Vieux a34d496738 cleanup all mentions of insert
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2017-06-02 00:06:29 +00:00
James Turnbull 99e2e8c292 Changed all references from Trusted Builds to Automated Builds
* Updated docker images output
* Deprecated docker images -t/--trusted option and replace with --automated
* Changed *trusted variables to *automated
* Changed added support for is_automated alongside deprecated is_trusted
* Updated man pages, docs and completion
* Updated API documentation

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
2017-06-02 00:06:28 +00:00
LK4D4 41429fd727 Using names in docker ps --since-id/--before-id, resolves #3565
Also renames --since-id/--before-id to --since/--before and add errors
on non-existent containers.
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2017-06-02 00:06:23 +00:00
Tianon Gravi 632263387f Update bash completion to ignore stderr output of docker binary
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:20 +00:00
Tianon Gravi d24c5c599d Switch `docker run --username` to `docker run --user` which is more accurate (while we can still do so without breaking anyone's scripts)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:20 +00:00
Tianon Gravi 3ca9415d56 Resync bash completion to include all flags defined in the code, and to autocomplete properly on all parameters that are reasonably possible to do so on today
This also includes several new minor features that are interesting, so do explore a little. :)

Finally, this also fixes a few bugs where commands would complete parameters that they won't necessarily accept.  We still have a few of these cases, but they're reduced to a minimum now.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2017-06-02 00:06:20 +00:00
Victor Vieux 33415ebe36 update commands.go
update docker.go

move to pkg

update docs

update name and copyright

change --sinceId to --since-id, update completion and docs

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor@docker.com> (github: vieux)
2017-06-02 00:06:19 +00:00
Thomas LEVEIL bc7722ea0f support for container names in bash completion 2017-06-02 00:06:19 +00:00
Victor Vieux e074bc6db1 rebase and add some filters 2017-06-02 00:06:19 +00:00
Tianon Gravi 24c9b31edf Move contrib/docker.bash to contrib/completion/bash/docker for better organization 2017-06-02 00:06:19 +00:00