summaryrefslogtreecommitdiffstats
path: root/contrib/zsh-completion
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-11-18 03:45:35 +0100
committerJames Rayner <james@archlinux.org>2009-11-18 03:45:35 +0100
commit3cbb28408f4537fbc7beaa7148458f0db3f02baf (patch)
treefb3a3ee659f0bb6c828f162180a1a36f905b570d /contrib/zsh-completion
parentedf633af40487375d5c663ac217d42924214e130 (diff)
downloadnetctl-3cbb28408f4537fbc7beaa7148458f0db3f02baf.tar.gz
netctl-3cbb28408f4537fbc7beaa7148458f0db3f02baf.tar.xz
FS#13418,FS#12505 - add zsh/bash completion
Diffstat (limited to 'contrib/zsh-completion')
-rw-r--r--contrib/zsh-completion23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/zsh-completion b/contrib/zsh-completion
new file mode 100644
index 0000000..9f74e42
--- /dev/null
+++ b/contrib/zsh-completion
@@ -0,0 +1,23 @@
+#compdef netcfg netcfg2=netcfg
+local -a disp
+
+all_profiles() {
+ _path_files -W "/etc/network.d" -g "*(.)"
+}
+
+up_profiles() {
+ _files -W "/var/run/network/profiles"
+}
+
+up_ifaces() {
+ _files -W "/var/run/network/interfaces"
+}
+
+_arguments -C \
+'(- *)-c[Start specified profile if its interface is not currently up]:Network profile:all_profiles' \
+'(- *)-d[Take specified profile down]:Active profiles:up_profiles' \
+'(- *)-a[Take all active profiles down]' \
+'(- *)-i[Take down profile active on specified interface]:Active interfaces:up_ifaces' \
+'(- *)-r[Disconnect and reconnect specified profile]:Active profiles:up_profiles' \
+'(- *)-u[Start specified profile]:Network profile:all_profiles' \
+'(- *)*:Network profile:all_profiles' \ No newline at end of file