From e81eb2874e2aae31c0241092c1b1d57ed66f6285 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 16 Feb 2016 18:17:01 -0500 Subject: 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 --- shell-completion/bash/systemd-nspawn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shell-completion/bash/systemd-nspawn') 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() { -- cgit v1.2.3-54-g00ecf From 6d94d993c753915a833456b4d86cc33eb3201e7c Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Sun, 20 Mar 2016 17:55:58 +0000 Subject: bash completion: add --template to nspawn --- shell-completion/bash/systemd-nspawn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell-completion/bash/systemd-nspawn') diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn index 8318f6e590..0cf249d8ce 100644 --- a/shell-completion/bash/systemd-nspawn +++ b/shell-completion/bash/systemd-nspawn @@ -60,14 +60,14 @@ _systemd_nspawn() { [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine -S --slice --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge --personality -i --image --tmpfs --volatile - --network-macvlan --kill-signal' + --network-macvlan --kill-signal --template' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in - --directory|-D) + --directory|-D|--template) compopt -o nospace comps=$(compgen -S/ -A directory -- "$cur" ) ;; -- cgit v1.2.3-54-g00ecf