aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/_binutils-config23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/_binutils-config b/src/_binutils-config
new file mode 100644
index 0000000..30064b3
--- /dev/null
+++ b/src/_binutils-config
@@ -0,0 +1,23 @@
+#compdef binutils-config
+
+local arguments
+
+arguments=(
+ '(- :)'{--get-current-profile,-c}'[print current profile]'
+ '(- :)'{--list-profiles,-l}'[print a list of available profiles]'
+ '(- :)'{--uninstall,-u}'[remove all signs of specified target]'
+ '(- :)'{--debug,-d}'[execute with debug output]'
+ '(- :)'{--help,-h}'[show help]'
+ '(- :):profiles:_binutils_profiles'
+)
+
+_binutils_profiles() {
+ local profiles
+ profiles=(${(f)"$(_call_program binutils-installed RC_NOCOLOR=yes binutils-config --list-profiles)"})
+ profiles=${${profiles/\[([^]]*)\]/}/\*}
+ _tags profiles && { compadd "$@" -k profiles || compadd "$@" ${(kv)=profiles} }
+}
+
+_arguments $arguments
+
+# vim: set et sw=2 ts=2 ft=zsh: