Add shopt -s extglob progcomp

Bug #439827 reported by Jari Aalto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash completion generator for bzr
Fix Released
Medium
Martin von Gagern

Bug Description

The "shopt -s extglob progcomp" is not the default setting in Bash.

Please add that line to the generated shell script, possibly testing the BASH version before using the command.

Revision history for this message
Martin von Gagern (gagern) wrote :

Setting progcomp at the top level makes sense. I'll introduce that.

Dealing with extgob is a bit more tricky. It has to be set inside the function, and if I wanted to not pollute the user's environment, I'd have to restore the previous state before returning. As there are three places where the function possibly returns, this might turn out to be a bit ugly.

I would assume that people seriously using bash completion were using the alioth bash-completion project as well. There are a lot of functions in there that require extglob but simply assume it's set. I would welcome a proper solution to this at the level of the bash-completion project, and have suggested such a solution to upstream:
http://alioth.debian.org/tracker/index.php?func=detail&aid=311628&group_id=100114&atid=413095

Unfortunately, it seems they haven't even looked at my suggestion. So waiting on bash-completion might take too long. And always requiring bash-completion might be bad, too. Therefore I might include some support for proper extglob handling in my script. I'll think about it.

Changed in bzr-bash-completion:
assignee: nobody → Martin von Gagern (gagern)
importance: Undecided → Medium
Revision history for this message
Martin von Gagern (gagern) wrote :

It seems that at least current versions of bash require the extglob shopt to be set when the function is defined, not when it is called. Therefore simply setting extglob at the global level will be enough, and if I want to, I can unset it after the function got defined. Will work on this.

Strange, I'm pretty sure that past versions of bash were behaving differently in this respect. Not completely sure, though.

Changed in bzr-bash-completion:
status: New → In Progress
Changed in bzr-bash-completion:
status: In Progress → Fix Committed
Revision history for this message
Martin von Gagern (gagern) wrote :

Released version 1.0.0, which doesn't even require extglob, and does set progcomp.

Changed in bzr-bash-completion:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.