Changed `out' parameter of `assert_bash_exec()' to accept also -1 and 0:
@param mixed $out (optional) Reference to variable to hold output.
If variable equals -1 (default) the bash command is
expected to return no output. If variable equals 0,
any output from the bash command is disregarded.
This fixes the situation of commit cfcf9fa where contrib/ri was causing
invisible errors when running the test suite.
Closes Alioth #311614
Globbing might occur if $cur contains one of these globbing characters: * ? [ ]
The bug becomes apparent:
On Cygwin if the glob-string contains backslashes as well, causing a warning (Cygwin >= 1.7):
MS-DOS style path detected: ...
Preferred POSIX equivalent is: ...
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
On Linux, using strace, you can see bash-completion doing an unnecessary `open' system call.
Steps to reproduce on Linux using `strace':
Environment: Linux, bash-completion-1.0
1. Start bash with bash-completion loaded and find out PID ($$):
$ echo $$
MYPID
2. In a second bash shell, `strace' the above PID:
$ strace -e trace=open -f -o strace.log -p MYPID
3. Within the first bash shell, type:
$ cur="?"; _kernel_versions
4. In the second bash shell, type ^C to quick `strace'.
5. Check `strace.log', here you can see bash accessing
something it shouldn't:
...
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
...
6. The above call to `open' disappears if $cur in _kernel_versions gets
quoted, and you repeat the steps above:
_kernel_versions()
{
COMPREPLY=( $( compgen -W '$( command ls /lib/modules )' -- "$cur" ) )
}
Needed to add okular-specific completions: xps, epub, odt, fb, mobi,
g3 and chm.
Also, okular can read any of its formats also in .gz/.bz2 compressed
format, so change the regular expression to match this.
From apt-cache(1):
-g, --generate
Perform automatic package cache regeneration, rather than use the
cache as it is. This is the default; to turn it off, use
--no-generate. Configuration Item: APT::Cache::Generate.
Should make calls to apt-cache faster.
- Added code comments to _get_cword, __get_cword3 & __get_cword4
- (testsuite) Added tests for _get_cword
- (testsuite) Bugfixes assert_bash_exec() && match_items()
Bash-4 splits COMP_WORDS using characters from COMP_WORDBREAKS, but has
a bug where quoted words are also splitted, see:
http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
__get_cword3 is used for bash-2/3 and __get_cword4 is used for bash-4.
__get_cword4 handles well temporarily disabling of COMP_WORDBREAK
characters, but fails quoted words (a 'b c) and subshells (a $(b c).
See the expected failures when running the automated tests.
__get_cword3 does a better job of returning quoted words.
To run the automated tests on bash-3/4:
$ ./runUnit _get_cword.exp [--tool_exec <path to bash-3/4 binary>]
Using option `--tool_exec' you can now specify which bash binary you
want to use:
$ ./runUnit --tool_exec /opt/bash-4/bin/bash
$ ./runCompletion --tool_exec /opt/bash-4/bin/bash
If not specified, current `bash' as found in the tcl path (/bin/bash)
will be used.
This reverts commit 584bc520dfbc0e6a7e949b885bb9b949f99a1ff9.
This commit broke "general" man completion, trying to give "pages"
(from man-pages(7)) after $ man |. This would've been ok only if
$ man man | (man man pages indeed works). Trying to look for a fix :)
assert_env_unmodified() now calls `diff_env' with `LAST-ARG' as the last
argument. Now $_ becomes `LAST_ARG' and $_ doesn't interfere with the
diff anymore as it would if $_ was the sed script.
Added line continuation (\) to bash script of `get_hosts_avahi()'.
Bash < 3.2.41 has a bug where 'history' disappears from SHELLOPTS
whenever a shopt setting is sourced or eval'ed. Disabling 'history'
makes it not show in tests "Environment should not be modified"
for bash < 3.2.41.
Added helper function `is_bash_version_minimal()' to
test/lib/library.sh.