1809 Commits

Author SHA1 Message Date
Freddy Vulto
9eb0ee2851 (test suite) Added global var `bash_versinfo_0'
This variable was introduced by unit/_get_cword.exp but is now upgraded
to a global var.
2009-10-02 16:39:11 +02:00
Freddy Vulto
d2c6b1ede0 (test suite) Added test for dd
Added test "option should be suffixed with ="
This test exhibits the bug (expected failure) that `dd if<TAB>' gets completed
with `\=' instead of `='.
2009-10-02 16:13:46 +02:00
Freddy Vulto
453a55e9c8 (testsuite) Fix assert_bash_exec to match prompt
Added documentation to "Testing" chapter:
- Running tests via cron
- Specifying bash binary
2009-10-02 10:53:00 +02:00
Ville Skyttä
369980bf93 Tell *Emacs to indent comments (sh-indent-comment: t).
Also move indentation settings to end of files and expand *Emacs ones to
local variables block to avoid overflowing 80 char lines.
2009-10-01 20:54:51 +03:00
Ville Skyttä
a7fb763fdd Remove unused ver variable, thanks to Elan Ruusamäe. 2009-09-29 20:41:14 +03:00
Ville Skyttä
9322da7992 Add more common options to rpm option completions. 2009-09-29 20:37:42 +03:00
Freddy Vulto
e6a18ac7cf Quoted $cur to prevent globbing
See Alioth #311614
2009-09-28 20:21:54 +02:00
Ville Skyttä
1453625e50 Prevent rpm --define/-D completions from falling through. 2009-09-27 10:18:43 +03:00
David Paleino
fa65e312ea Remove --with-suggests and --without-suggests from aptitude completion 2009-09-26 16:51:39 +02:00
Freddy Vulto
9501c0fa90 (testsuite) Fix assert_bash_exec output parameter
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.
2009-09-26 11:00:02 +02:00
Freddy Vulto
32f22b996a Quoted $cur to prevent quoting
See Alioth #311614, bash-completion.patch3
2009-09-25 21:30:45 +02:00
Freddy Vulto
b66425e8cf (testsuite) Remove test with non-portable filenames
Files containing a star (*) aren't support on FAT, thus Cygwin.
Closes Alioth #311979.
2009-09-25 20:28:00 +02:00
Freddy Vulto
0e9f5a3850 Fixed contrib/ri
Too much lines were deleted accidentally at the previous commit.
2009-09-25 09:57:37 +02:00
Freddy Vulto
e0feeacd54 Merge branch 'fvu' 2009-09-25 09:38:49 +02:00
Freddy Vulto
cfcf9fae8f Quote unquoted $cur to prevent globbing.
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" ) )
    }
2009-09-25 09:36:29 +02:00
Guillaume Rousse
174023db92 set additional variables needed by some completions (man and gcc, notably) 2009-09-24 23:23:04 +02:00
Freddy Vulto
f871fe4101 Fix dd to not break COMP_CWORDS on =
This fixes dd on bash-4 where COMP_CWORDS are broken on = as well.
2009-09-24 21:00:31 +02:00
David Paleino
5cd7272447 Correctly re-indent dd completion 2009-09-24 18:00:43 +02:00
David Paleino
975e950192 Split okular from evince filename extension completion, add okular-specific completions.
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.
2009-09-23 23:38:52 +02:00
Ville Skyttä
7e3c9af115 Support .xz suffix in info page completions. 2009-09-21 00:47:03 +03:00
Guillaume Rousse
d13d73345e document add completions 2009-09-20 22:13:52 +02:00
Guillaume Rousse
0643ce2567 simpler interface (kiss rules) 2009-09-20 22:12:18 +02:00
Guillaume Rousse
f5b6261826 add rfkill completion 2009-09-20 22:12:01 +02:00
David Paleino
b5e06b0ab9 Added --no-generate to "apt-cache pkgnames" calls (Debian: #547550)
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.
2009-09-20 19:45:27 +02:00
Ville Skyttä
aa45595251 Add /sbin to $PATH when invoking lspci and lsusb. 2009-09-20 18:33:24 +03:00
Freddy Vulto
f733e71e1f Split _get_cword into bash-3/4 versions
- 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>]
2009-09-20 14:11:26 +02:00
Freddy Vulto
fcf2bf91c9 (testsuite) Added `stdout' to assert_bash_exec()
Added support to assert_bash_exec() to retrieve bash output within
tcl/expect.
2009-09-20 13:07:04 +02:00
Freddy Vulto
fc3f65e6dd (testsuite) Supported specifying bash 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.
2009-09-20 12:59:08 +02:00
David Paleino
679a87d91b Revert "Added completion for lintian/lintian-info"
This reverts commit c200e468d61b88bcf4d14253daf42c066929bfa9.

Filing the completion to the proper package, don't keep it in
upstream's bash-completion
2009-09-19 00:53:24 +02:00
David Paleino
c200e468d6 Added completion for lintian/lintian-info 2009-09-18 23:59:41 +02:00
David Paleino
f061b21ef9 Clean [1.2.3.4]:port format in known_hosts, thanks to Xuefer (Gentoo: #284563) 2009-09-17 23:05:52 +02:00
David Paleino
3a69bd3e93 Improve service(8) completion, also look for "msg_usage" (thanks to Elan Ruusamäe <glen@delfi.ee>) 2009-09-17 22:24:21 +02:00
David Paleino
f13ea4968b Avoid sed pipe as ps itself can omit the headers (thanks to Elan Ruusamäe) 2009-09-17 22:20:29 +02:00
David Paleino
7bc1813148 Revert "Support "man cmd subcmd" completion in contrib/man (Debian: #545411)"
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 :)
2009-09-17 18:25:25 +02:00
David Paleino
584bc520df Support "man cmd subcmd" completion in contrib/man (Debian: #545411) 2009-09-17 18:06:24 +02:00
Freddy Vulto
046f2abc6f (testsuite) Tighten `match_items()'
An item now must match at the beginning of the line, to prevent
mismatches.
2009-09-16 23:17:56 +02:00
Freddy Vulto
451b920377 Merge branch 'fvu' 2009-09-16 22:22:07 +02:00
Freddy Vulto
171fc0e3c6 (testsuite) Added more tests for _get_cword
To run the tests:

   cd test && ./runUnit _get_cword.exp
2009-09-16 22:20:15 +02:00
Freddy Vulto
fe88919de4 (testsuite) Fix assert_env_unmodified() & get_hosts_avahi()
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()'.
2009-09-16 22:14:53 +02:00
Freddy Vulto
c6a8b856de (testsuite) set +o history for bash < 3.2.41
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.
2009-09-16 22:05:23 +02:00
David Paleino
0b35bdb5af Fixed obvious brokenness (typos) in contrib/mdadm 2009-09-16 20:33:53 +02:00
David Paleino
796a7f4e37 Added sshfs completion (shares the same as scp) (Debian: #545978) 2009-09-16 14:23:22 +02:00
David Paleino
0a727a5cdc Add changelog line for commit 3fe193f81a3e 2009-09-16 14:21:08 +02:00
David Paleino
f86fa99740 Added changelog line for commit 1421e55 2009-09-16 12:59:34 +02:00
David Paleino
7e379590b2 Improve qemu completion (Debian: #534901) 2009-09-16 12:53:23 +02:00
David Paleino
86d6d20cb0 Added m4v completion to mplayer (Debian: #504213) 2009-09-16 12:16:56 +02:00
Guillaume Rousse
3649c03967 additional comments about the goal of the script 2009-09-15 00:27:47 +02:00
Guillaume Rousse
f262487650 fix typo 2009-09-15 00:23:26 +02:00
Guillaume Rousse
8e496adff3 initial import 2009-09-14 23:01:19 +02:00
Guillaume Rousse
5b760a88bb add mdam and resolvconf completion to installed files list 2009-09-14 21:49:44 +02:00