mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
completions: add basic completions for 'ip netns'
This commit is contained in:
parent
651f3cf863
commit
5cf24b7733
@ -194,6 +194,12 @@ function __fish_ip_scope
|
||||
host "Address is only valid on this host"
|
||||
end
|
||||
|
||||
function __fish_ip_netns_list
|
||||
ip netns list | while read a b c
|
||||
echo -- $a
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_ip_types
|
||||
printf '%s\t%s\n' \
|
||||
macvtap "Virtual interface based on link layer address (MAC) and TAP." \
|
||||
@ -379,6 +385,25 @@ function __fish_complete_ip
|
||||
case help
|
||||
end
|
||||
end
|
||||
case netns
|
||||
if not set -q cmd[3]
|
||||
printf '%s\t%s\n' add "Add network namespace" \
|
||||
delete "Delete network namespace" \
|
||||
set "Change network namespace attributes" \
|
||||
identify "Display network namespace for a process id" \
|
||||
pids "Display process ids of processes running in network namespace" \
|
||||
monitor "Report as network namespace names are added and deleted" \
|
||||
exec "Execute command in network namespace" \
|
||||
help "Display help" \
|
||||
list "List network namespaces"
|
||||
else
|
||||
switch $cmd[2]
|
||||
case delete
|
||||
__fish_ip_netns_list
|
||||
case exec
|
||||
__fish_ip_netns_list
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user