summaryrefslogtreecommitdiff
path: root/shell-completion/bash/systemd-nspawn
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-16 18:17:01 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-18 11:50:53 -0500
commite81eb2874e2aae31c0241092c1b1d57ed66f6285 (patch)
tree9559ec7265ea13d9ca766cd156e5befa24d14884 /shell-completion/bash/systemd-nspawn
parente1caa6e09b9698d629dc6a7a166e12ea8752aedd (diff)
systemd-resolve: initial shell completion
v2: - use /sys/class/net to list interfaces, also copy the same code to systemd-nspawn v3: - do not propose "any" twice for --type
Diffstat (limited to 'shell-completion/bash/systemd-nspawn')
-rw-r--r--shell-completion/bash/systemd-nspawn5
1 files changed, 4 insertions, 1 deletions
diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn
index 429e712eb3..8318f6e590 100644
--- a/shell-completion/bash/systemd-nspawn
+++ b/shell-completion/bash/systemd-nspawn
@@ -45,7 +45,10 @@ __get_env() {
}
__get_interfaces(){
- cut -f 1 -d ' ' /proc/net/dev | tail -n +3 | tr -s '\n' | tr -d ':' | xargs
+ { cd /sys/class/net && echo *; } | \
+ while read -d' ' -r name; do
+ [[ "$name" != "lo" ]] && echo "$name"
+ done
}
_systemd_nspawn() {