attaching a patch. I think I tested everything I changed. I replaced the loop over ls output with grep -l | sed.
I made a bunch of overall changes and improvements to the script, too. When completing an empty word, instead of returning the full list of all available packages, all PIDs, and all files in the current directory, list just symptoms and made-up stand-in describing what arguments it accepts Completion doesn't list short options, just the long-option version. If you don't know what option you want, a letter doesn't tell you anything. $ apport-bug [TAB] audio dist-upgrade storage #buggy-file# --help --tag #buggy-package# release-upgrade ubuntu-release-upgrader #buggy-process-id# --save --version display security --window File and directory completion via _filedir, compopt -o dirnames fallback, or complete -f -d, never via complete -G "$cur*" or anything similarly horrible that will break with spaces in filenames. Also tidied up the functions. I think the point of some code duplication was to special-case completing the bare command, and only list --help and --version if we were completing the first argument. (which was kind of moot when completion output also included something like 40k package names...) Could still do that by checking $cword. ** Patch added: "several fixes: don't break with aliased ls, major speed improvements, keep results small when completing an empty word, and handle spaces" https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1221503/+attachment/4272391/+files/apport-completion.pjc.patch ** Changed in: apport (Ubuntu) Status: New => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1221503 Title: completion with ubuntu-bug complains about missing release-upgrade.py To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1221503/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs