Skip to content

Conversation

@akinomyoga
Copy link
Collaborator

Resolve #668

@akinomyoga
Copy link
Collaborator Author

This isn't directly related to this fix, but I have a question.

Usage of _expand in completions/{info,man}

When I was checking the use cases of _expand in bash-completion, I found the following codes in completions/{info,man} (see completions/info#L9 and completions/man#L55):

    if [[ $cur == @(*/|[.~])* ]]; then
        _filedir "$manext"
        return
    fi

    [...]

    _expand || return

Since cur doesn't seem to be modified between these lines, cur will not start with a tilde at the line _expand is called. However, _expand does something only when cur stars with a tilde. These invocations of _expand don't seem to do anything. Are they needed?

@scop scop merged commit 6f5ec1b into scop:master Dec 25, 2021
@akinomyoga akinomyoga deleted the fix-failglob-for-_expand branch December 25, 2021 21:24
@scop
Copy link
Owner

scop commented Dec 25, 2021

Thanks!

And good catch re info and man, I believe those _expand calls can be removed. Related commits are at least 1b85a1b and add4e3c -- unfortunately in the latter I failed to elaborate why exactly were those calls deferred, but I guess it was because they didn't need to be run at that point. And I'm not sure why they'd need to be run at all, at least they have been no-ops since.

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.

~ complete is broken

2 participants