File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Include this script in your shell PATH to enable argument completion for IREE
4+ # tools.
5+
6+ _iree_tools_autocomplete () {
7+ local tool=" $1 "
8+ local commands
9+ local cur
10+
11+ # Get the list of commands from the appropriate tool's `--help-list`
12+ commands=$( $tool --help-list | awk ' {print $1}' | grep -v ' ^ *=' | sed ' s/[=<].*//' )
13+
14+ cur=${COMP_WORDS[COMP_CWORD]}
15+
16+ case " $cur " in
17+ -* )
18+ COMPREPLY=($( compgen -W " $commands " -- " ${cur} " ) )
19+ ;;
20+ * )
21+ COMPREPLY=($( compgen -f -- " ${cur} " ) )
22+ ;;
23+ esac
24+
25+ return 0
26+ }
27+
28+ # Register the completion function for iree-opt
29+ complete -F _iree_tools_autocomplete iree-opt
30+ # Register the completion function for iree-compile
31+ complete -F _iree_tools_autocomplete iree-compile
You can’t perform that action at this time.
0 commit comments