summaryrefslogtreecommitdiff
path: root/completions/ifup
diff options
context:
space:
mode:
Diffstat (limited to 'completions/ifup')
-rw-r--r--completions/ifup25
1 files changed, 25 insertions, 0 deletions
diff --git a/completions/ifup b/completions/ifup
new file mode 100644
index 00000000..aab9bbca
--- /dev/null
+++ b/completions/ifup
@@ -0,0 +1,25 @@
+# Red Hat & Debian GNU/Linux if{up,down} completion
+#
+[ $USERLAND = GNU ] || return 1
+
+_ifupdown()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [ $cword -eq 1 ]; then
+ _configured_interfaces
+ COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
+ fi
+
+ return 0
+} &&
+complete -F _ifupdown ifup ifdown ifstatus
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh