[Bug 474361] New: bash competion fail to complete names with spaces
https://bugzilla.novell.com/show_bug.cgi?id=474361 Summary: bash competion fail to complete names with spaces Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: All OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jreidinger@novell.com QAContact: qa@suse.de CC: jkupec@novell.com Found By: Development Created an attachment (id=271582) --> (https://bugzilla.novell.com/attachment.cgi?id=271582) new bash completion for zypper I attach completion script for zypper. this script have problems with repositories which contain spaces. e.g. I have repository "openSUSE 11.1" and this bash completion: zofie:/home/jreidinger # zypper modifyrepo 11.1-0 --name repo-debug --all nofac repo-non-oss --disable --no-keep-packages repo-oss --enable --no-refresh Repository fate openSUSE\ repo-source --keep-packages Packman\ repo-update --local --priority trans --medium-type --refresh xfce moje --remote zofie:/home/jreidinger # zypper modifyrepo o 11.1-0 openSUSE\ zofie:/home/jreidinger # zypper modifyrepo openSUSE\ 1 11.1-0 openSUSE\ zofie:/home/jreidinger # zypper modifyrepo openSu (no help) zofie:/home/jreidinger # zypper modifyrepo openSUSE\ 12 11.1-0 openSUSE\ So problem is in incostistency showed help and also that because this is last option it should autocomplete it. I fill it as 'openSUSE\ 11.1-0' so I think partially it must be accepted. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=474361
Pavol Rusnak
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c1
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c2
Ján Kupec
Tip: remove the package bash-completion. It's broken.
AFAIK, this has nothing to do with bash-completion package.
Beside this the /etc/bash_completion.d/zypper.sh is broken.
The old one is, but Josef is trying to make it work (see the attached script), and he has a problem with completing strings which contain whitespace. He wants to complete them with whitespace already escaped, so that the user just hits enter after the value is completed. I guess he uses something like: compgen -W "'asdf\ long' 'asfd' ..." ... and this fails (see c#0). Can you help with this? Is this a bug (compgen, bash)? Or if you're not the one to handle this, do you have an idea who is? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c3
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c4
Ján Kupec
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c5
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c6
--- Comment #6 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c7
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c10
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c11
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c12
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c13
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c14
Ján Kupec
Please, this is not my bug ... stop assigning me this bug.
You reassigned it to yourself the last time :O) Check the history
The original shell from attachment #271582 [details] script was never written by me nor I've done any change to this script.
Nobody ever said that. All that was said is that there could have been a bug in bash. But you showed us a way out of it, so thanx again. So the problem was the use of the default IFS we one expects those white characters in the to-be-completed strings? BTW, i guess the right way to handle this report should be to leave it assigned to you and resolve as INVALID, but i won't argue with you anymore :O) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c15
--- Comment #15 from Ján Kupec
So the problem was the use of the default IFS we one expects those white ^^ when
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=474361
User werner@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c16
--- Comment #16 from Dr. Werner Fink
All that was said is that there could have been a bug in bash. But you showed us a way out of it, so thanx again.
There is no bug in bash completion ... beside that is is not very handy like completion in tcsh or zsh. As you can see from script in attachment #273967 it requires wide bash knowledge to write such scripts ... a reason why some of the hasty written completion functions of the bash_completion package will fail in some corner cases. And the reason why simple completions for the cd command leads into such large shell function as found in /etc/profile.d/complete.bash ... you may compare this with /etc/profile.d/complete.tcsh ... last one is (IMHO) much more reliable. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c17
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=474361
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=474361#c18
Ján Kupec
participants (1)
-
bugzilla_noreply@novell.com