Skip to content

Commit e12cf4c

Browse files
committed
feat: add support for fish
- ament/ament_package#164 - ros2#326 Signed-off-by: sunrisepeak <speakshen@163.com>
1 parent ef39b60 commit e12cf4c

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

ros2cli/colcon.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"hooks": [
33
"share/ros2cli/environment/ros2-argcomplete.bash",
4+
"share/ros2cli/environment/ros2-argcomplete.fish",
45
"share/ros2cli/environment/ros2-argcomplete.zsh"
56
]
67
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2017-2026 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Register ros2 tab-completion for fish shell via argcomplete.
16+
# Use "| source" (pipe into source) so that multi-line output is handled
17+
# correctly — fish command substitution (…) would join lines with spaces.
18+
19+
if type -q register-python-argcomplete
20+
register-python-argcomplete --shell fish ros2 | source
21+
else if type -q register-python-argcomplete3
22+
register-python-argcomplete3 --shell fish ros2 | source
23+
end

ros2cli/resource/package.dsv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
source;share/ros2cli/environment/ros2-argcomplete.bash
2+
source;share/ros2cli/environment/ros2-argcomplete.fish
23
source;share/ros2cli/environment/ros2-argcomplete.zsh

ros2cli/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
]),
2222
('share/ros2cli/environment', [
2323
'completion/ros2-argcomplete.bash',
24-
'completion/ros2-argcomplete.zsh'
24+
'completion/ros2-argcomplete.fish',
25+
'completion/ros2-argcomplete.zsh',
2526
]),
2627
],
2728
package_data={'': ['py.typed']},

0 commit comments

Comments
 (0)