2130 Commits

Author SHA1 Message Date
Ville Skyttä
e31f8d8b81 Update freshmeat.net URLs. 2009-10-13 22:24:59 +03:00
David Paleino
dbb3510524 Fixed "freq" and "rate" completion for iwconfig
Should be tested on bash < 4; on bash4 it gave:

    awk: /^[[:space:]]*Channel/ {print $4\"G\"}
    awk:                                 ^ backslash not last character on line

  (similarly for "rate")
2009-10-12 13:02:52 +02:00
Ville Skyttä
b2d7d98eeb Apply pine completion to alpine too. 2009-10-11 22:16:35 +03:00
Ville Skyttä
e2c1f4117f Apply cardctl completion to pccardctl too. 2009-10-11 21:17:29 +03:00
Ville Skyttä
dfb23dc917 Add missing entries. 2009-10-11 21:15:41 +03:00
Ville Skyttä
419bcb44aa bluez-utils was merged to bluez as of 4.x, rename completion accordingly. 2009-10-11 21:10:07 +03:00
David Paleino
bb8912b06f Don't use pidof in _known_hosts_real() to detect whether Avahi is available
It's not available on MacOS X.
    Thanks to Rainer Müller <raimue@codingfarm.de>
    (bash-completion MacPorts maintainer)
2009-10-11 11:12:09 +02:00
Ville Skyttä
e2c20d96e9 Include profile snippet in tarball, install it. 2009-10-10 23:01:13 +03:00
Ville Skyttä
d03719181f Include CHANGES in dist tarball. 2009-10-10 22:48:43 +03:00
Ville Skyttä
0eb5f49dcd Create bz2 dist tarball too. 2009-10-10 22:46:54 +03:00
Guillaume Rousse
463568bc48 pattern based file completions are defined in main file 2009-10-04 23:02:55 +02:00
Guillaume Rousse
b56a8dfaae fix conflicts 2009-10-04 19:46:01 +02:00
Guillaume Rousse
506e1cb3eb new indentation policy 2009-10-04 19:42:50 +02:00
Freddy Vulto
bb47efd9b6 (testsuite) Allow trailing space on one completion
Within `match_items', if only one completion is generated, an (optional)
trailing space is allowed, because -o nospace might not be in effect.
2009-10-04 18:18:29 +02:00
Freddy Vulto
1be84710d2 Silence completing scp/sftp/ssh -F '' on bash-4
This fixes a bug under bash-4 where completing:

   scp -F 'spaced  conf' <TAB>

causes `dequote' to yield errors:

    bash: eval: line 1: unexpected EOF while looking for matching `''
    bash: eval: line 2: syntax error: unexpected end of file

The bug occurs because of a bug in bash-4.0, where quoted words are split
unintended, see: http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html

Workaround is now to silence `dequote' in case of errors and wait for bash-4 to
be fixed...
2009-10-04 18:14:16 +02:00
Freddy Vulto
5177db1a58 Revert commit d3187b6f3
Reverting yesterdays commit d3187b6f3 (Bugfix completing scp/sftp/ssh -F '' on bash-4), which said:

    set -- "${COMP_LINE:0:$COMP_POINT}"

The problem with the line above is that it needs to be unquoted for `set' in order to break up COMP_LINE into separate arguments:

    set -- ${COMP_LINE:0:$COMP_POINT}

But this will yield error "unexpected EOF while looking for matching `''" if COMP_LINE is containing unbalanced single/double quotes, e.g.:

    eval set -- scp -F 'config
2009-10-04 18:08:33 +02:00
Freddy Vulto
8455b7ef38 Fix comment 2009-10-03 23:27:40 +02:00
Freddy Vulto
d3187b6f35 Bugfix completing scp/sftp/ssh -F '' on bash-4
Use ${COMP_LINE:0:$COMP_POINT} instead of ${COMP_WORDS[@]} when searching for
-F configfile in scp/sftp/ssh.  This fixes a bug under bash-4 where completing:

   scp -F 'spaced  conf' <TAB>

causes `dequote' to yield errors:

    bash: eval: line 1: unexpected EOF while looking for matching `''
    bash: eval: line 2: syntax error: unexpected end of file

The bug occurs because of a bug in bash-4.0, where quoted words are split
unintended, see: http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html

Also, using ${COMP_LINE:0:$COMP_POINT} is an improvement, because it takes the
current cursor position into account.
2009-10-03 23:23:48 +02:00
David Paleino
18081e0d86 Updating changelog timestamp, freezing for 1.1 2009-10-03 15:42:46 +02:00
Freddy Vulto
9c53f0d6e6 (testsuite) Added empty directories to git
Empty directories are ignored by git.  By putting an empty .gitignore in
the directory, the directory can be added to git.
2009-10-03 09:39:55 +02:00
Freddy Vulto
4259efb5c4 (doc) Added sample cron.sh for test suite 2009-10-03 08:34:14 +02:00
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