Skip to content

Commit

Permalink
to support complete for rosidl and avoid calling multiple compinit
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Lihui <[email protected]>
  • Loading branch information
Chen Lihui committed Aug 15, 2022
1 parent b8381d9 commit d8cacb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions rosidl_cli/colcon.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": [
"share/rosidl_cli/environment/rosidl-argcomplete.bash",
"share/rosidl_cli/environment/rosidl-argcomplete.zsh"
]
}
6 changes: 4 additions & 2 deletions rosidl_cli/completion/rosidl-argcomplete.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
if ! type complete > /dev/null 2>&1; then
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
fi

# Get this scripts directory
__rosidl_cli_completion_dir=${0:a:h}
Expand Down

0 comments on commit d8cacb3

Please sign in to comment.