completion/ssh-copy-id: add completion#9675
Merged
mqudsi merged 4 commits intofish-shell:masterfrom Mar 22, 2023
Merged
Conversation
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
mqudsi
reviewed
Mar 22, 2023
share/completions/ssh-copy-id.fish
Outdated
Comment on lines
+2
to
+4
| function __ssh_history_completions | ||
| history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1' | ||
| end |
Contributor
There was a problem hiding this comment.
I'm not sure how I feel about this. You're copying the function definition from ssh.fish but you're not giving it a new name. If someone runs into an issue with ssh.fish's function at some later date, they might end up running into issues trying to see why their function definition isn't being reflected.
Since there's a good chance ssh.fish was already loaded, you can try type -q __ssh_history_completions || source ./ssh.fish at the top of this script, or move __ssh_history_completions to its own file in share/functions/__ssh_history_completions.fish.
Contributor
Author
There was a problem hiding this comment.
Got that, just extract to a split function in function folder.
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
mqudsi
pushed a commit
that referenced
this pull request
Mar 22, 2023
Add completions for ssh-copy-id. Refactored __ssh_history_completions into its own file for autoloading across completions. (cherry picked from commit 45b6622) Conflicts: CHANGELOG.rst
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Talk about your changes here.
Fixes issue #
TODOs: