mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #30132 from albers/completion_hide_legacy_commands
Honour $DOCKER_HIDE_LEGACY_COMMANDS in bash completion
This commit is contained in:
commit
2dd3aa608d
1 changed files with 25 additions and 18 deletions
|
@ -3966,11 +3966,30 @@ _docker() {
|
||||||
local previous_extglob_setting=$(shopt -p extglob)
|
local previous_extglob_setting=$(shopt -p extglob)
|
||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
local commands=(
|
local management_commands=(
|
||||||
attach
|
|
||||||
build
|
|
||||||
commit
|
|
||||||
container
|
container
|
||||||
|
image
|
||||||
|
network
|
||||||
|
node
|
||||||
|
plugin
|
||||||
|
secret
|
||||||
|
service
|
||||||
|
stack
|
||||||
|
system
|
||||||
|
volume
|
||||||
|
)
|
||||||
|
|
||||||
|
local top_level_commands=(
|
||||||
|
build
|
||||||
|
login
|
||||||
|
logout
|
||||||
|
run
|
||||||
|
search
|
||||||
|
version
|
||||||
|
)
|
||||||
|
|
||||||
|
local legacy_commands=(
|
||||||
|
commit
|
||||||
cp
|
cp
|
||||||
create
|
create
|
||||||
diff
|
diff
|
||||||
|
@ -3978,20 +3997,14 @@ _docker() {
|
||||||
exec
|
exec
|
||||||
export
|
export
|
||||||
history
|
history
|
||||||
image
|
|
||||||
images
|
images
|
||||||
import
|
import
|
||||||
info
|
info
|
||||||
inspect
|
inspect
|
||||||
kill
|
kill
|
||||||
load
|
load
|
||||||
login
|
|
||||||
logout
|
|
||||||
logs
|
logs
|
||||||
network
|
|
||||||
node
|
|
||||||
pause
|
pause
|
||||||
plugin
|
|
||||||
port
|
port
|
||||||
ps
|
ps
|
||||||
pull
|
pull
|
||||||
|
@ -4000,23 +4013,15 @@ _docker() {
|
||||||
restart
|
restart
|
||||||
rm
|
rm
|
||||||
rmi
|
rmi
|
||||||
run
|
|
||||||
save
|
save
|
||||||
search
|
|
||||||
secret
|
|
||||||
service
|
|
||||||
stack
|
|
||||||
start
|
start
|
||||||
stats
|
stats
|
||||||
stop
|
stop
|
||||||
swarm
|
swarm
|
||||||
system
|
|
||||||
tag
|
tag
|
||||||
top
|
top
|
||||||
unpause
|
unpause
|
||||||
update
|
update
|
||||||
version
|
|
||||||
volume
|
|
||||||
wait
|
wait
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4024,6 +4029,8 @@ _docker() {
|
||||||
deploy
|
deploy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local commands=(${management_commands[*]} ${top_level_commands[*]} ${DOCKER_HIDE_LEGACY_COMMANDS:+${legacy_commands[*]}})
|
||||||
|
|
||||||
# These options are valid as global options for all client commands
|
# These options are valid as global options for all client commands
|
||||||
# and valid as command options for `docker daemon`
|
# and valid as command options for `docker daemon`
|
||||||
local global_boolean_options="
|
local global_boolean_options="
|
||||||
|
|
Loading…
Reference in a new issue