Skip to content

fix(scp,rsync): fix misc bugs and refactor #1371

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

akinomyoga
Copy link
Collaborator

I separated small changes out of #1357. There are still eight commits, but I think they are mostly trivial fixes. If this is still too large as a PR, I'll further split the PR.

For these small changes, there are no ongoing discussions in #1357.

I'm thinking of separating the other non-trivial changes into PRs with smaller numbers of commits. I'll submit them after merging this PR.

This was because the filtering by a modified `cur` is performed after
prefixing "-F".  Since we generate the filenames starting with "$cur",
we do not need to further filter the results with `cur`.  We disable
the filtering by specifying the `-R` flag to `_comp_compgen`.
In sed, /[^\/]/ does not mean "a character that is not a slash".  It
means "a character that is not a backslash or a slash".  In the
bracket expressions [...], slashes do not need to be escaped by a
backslash, and also, a backslash is treated literally.  We should
instead use /[^/]/.
The type-classifier characters for named pipes (|) and sockets (=)
were not properly removed.  These are escaped by a backslash before
removing, so the backslashes are left.  In this patch, we remove the
type-classifier characters before performing the backslash escaping.
These shellcheck directives were added in commit c906aeb (2020-04-10),
but the latest version of shellcheck-0.10.0 does not seem to warn
about SC2089 and SC2090 on these lines for the current version of
bash_completion.

These warnings seem to be issued when unquoted
$_comp_cmd_scp__path_esc is used, such as

    echo $_comp_cmd_scp__path_esc

We have already resolved those unquoted variable expansions, so the
warning should no longer happen.  In this patch, we remove those
outdated shellcheck directives.
pytest.skip cancels the execution of the current test, so "return" and
subsequent codes arex unreachable.  We do not need to explicitly call
"return" in this context.

scop#1357 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant