Skip to content

feat(*sum): handle more common checksum filenames #1348

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

scop
Copy link
Owner

@scop scop commented Mar 12, 2025

checksums, checksums.txt, ${sumtype}sums, ${sumtype}sums.txt

checksums, checksums.txt, ${sumtype}sums, ${sumtype}sums.txt
for opt in "${words[@]}"; do
if [[ $opt == -@(c|-check) ]]; then
_comp_compgen_filedir "$sumtype"
_comp_compgen -v files filedir &&
_comp_compgen -- -X "!$sumglob" -W '"${files[@]}"'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filters out directory names generated by _comp_compgen_filedir, but we might want to generate also directory names.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true, drafting until fixed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in #1358 (comment) a bit, I'm currently thinking of extending _comp_compgen_filedir to accept options to specify the whole glob pattern (instead of just the filename-extension part).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants