-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Fish shell #326
Draft
ruffsl
wants to merge
5
commits into
ros2:rolling
Choose a base branch
from
ruffsl:fish
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"hooks": [ | ||
"share/ros2cli/environment/ros2-argcomplete.bash", | ||
"share/ros2cli/environment/ros2-argcomplete.fish", | ||
"share/ros2cli/environment/ros2-argcomplete.zsh" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2017-2019 Open Source Robotics Foundation, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if type register-python-argcomplete3 > /dev/null 2>&1 | ||
eval "register-python-argcomplete3 --shell fish ros2 | source" | ||
else if type register-python-argcomplete > /dev/null 2>&1 | ||
eval "register-python-argcomplete3 --shell fish ros2 | source" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# reduced from ament_package/template/package_level/local_setup.fish.in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file doesn't exist atm? |
||
|
||
# provide AMENT_CURRENT_PREFIX to shell script | ||
set -l AMENT_CURRENT_PREFIX (cd (dirname (status -f))/../.. && pwd) | ||
# store AMENT_CURRENT_PREFIX to restore it before each environment hook | ||
set -l _package_local_setup_AMENT_CURRENT_PREFIX $AMENT_CURRENT_PREFIX | ||
|
||
# unset AMENT_ENVIRONMENT_HOOKS | ||
# if not appending to them for return | ||
if [ -z "$AMENT_RETURN_ENVIRONMENT_HOOKS"] | ||
set -e AMENT_ENVIRONMENT_HOOKS | ||
end | ||
|
||
# restore AMENT_CURRENT_PREFIX before evaluating the environment hooks | ||
set -l AMENT_CURRENT_PREFIX $_package_local_setup_AMENT_CURRENT_PREFIX | ||
# list all environment hooks of this package | ||
ament_append_value AMENT_ENVIRONMENT_HOOKS "$AMENT_CURRENT_PREFIX/share/ros2cli/environment/ros2-argcomplete.fish" | ||
# source all shell-specific environment hooks of this package | ||
# if not returning them | ||
if [ -z "$AMENT_RETURN_ENVIRONMENT_HOOKS"] | ||
set -l _package_local_setup_IFS $IFS | ||
set -l IFS ":" | ||
for _hook in $AMENT_ENVIRONMENT_HOOKS | ||
# restore AMENT_CURRENT_PREFIX for each environment hook | ||
set AMENT_CURRENT_PREFIX $_package_local_setup_AMENT_CURRENT_PREFIX | ||
# restore IFS before sourcing other files | ||
set IFS $_package_local_setup_IFS | ||
source "$_hook" | ||
end | ||
set IFS $_package_local_setup_IFS | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
eval
andsource
looks weird - are both really necessary?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.
command is deprecated as thesource
command is preferred: fish-shell/fish-shell#310But I suppose the eval might not be needed. I was just mimicking the style in bash file.
Why was eval used there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is the recommended approach described in the
argcomplete
docs: https://argcomplete.readthedocs.io/en/latest/#synopsis