1970 Commits

Author SHA1 Message Date
Ville Skyttä
6e2b17c4e6 Add deprecation status/reason comments. 2009-12-08 19:46:19 +02:00
Ville Skyttä
7248290e6e Deprecate modules completion, upstream modules >= 3.2.7 ships one. 2009-12-08 19:45:35 +02:00
Ted Stern
af26cfb285 Fix modules completion for "(default)" entries. 2009-12-08 19:43:00 +02:00
Freddy Vulto
098dc9c1b8 Remove unused local variable `wordbreaks'
in function `__reassemble_comp_words_by_ref()'
2009-12-07 09:28:49 +01:00
Freddy Vulto
08c5878483 Merged __get_cword3 & __get_cword4 to _get_cword
Actually enhanced __get_cword3 to _get_cword, and removed __get_cword4.
__get_cword4 could handle chars to exclude from COMP_WORDBREAKS, but
failed with partial quoted arguments (e.g. "a 'b c|", | = cursor
position).  This was no problem till bash-4.0.35, because bash < 4.0.35
also returned partial quoted arguments incorrectly.  See also:
http://www.mail-archive.com/bug-bash@gnu.org/msg06094.html

Now that bash-4.0.35 returns quoted arguments ok, __get_cword3 is
enhanced to also handle chars to exclude from COMP_WORDBREAKS.  Because
__get_cword3 also handles partial quoted arguments correctly, this makes
__get_cword3 suitable for bash-4 as well.
2009-12-06 23:16:31 +01:00
Freddy Vulto
8a70568066 (testsuite) Centralized test start functions
Code in `unit_start()' and `completion_start()' is merged and put central in
lib/library.exp:
- start_bash()
- source_bash_completion()
- init_tcl_bash_globals()

Global string variable `bash_versinfo_0' is replaced with list variable
`BASH_VERSINFO'.
2009-12-05 14:53:47 +01:00
Freddy Vulto
c4f3e907cd (testsuite) Fix screen test
Completing directories after `screen -c' passes on bash-4 now that
_filedir does a `compopt -o filenames'.
The test yields an expected failure on bash-3.
2009-12-04 22:12:54 +01:00
Freddy Vulto
932a4db5df (testsuite) Fix scp completions
match_items() now does a better job at maintaining a tcl list, that's
probably why the double escaping at scp isn't necessary anymore.
2009-12-03 18:44:30 +01:00
Freddy Vulto
eb860b7b9f Added helper function __expand_tilde_by_ref()
Expands only tilde (~), if first char, in variable.
This function displays bash's capabilities of passing a variable by
reference (variable indirection) which allows us to avoid using a
subshell.  As far as I can see it works surprisingly well?

To run the automated test:

    ./runUnit __expand_tilde_by_ref.exp

Also fixed some testsuite issues regarding list splitting.
2009-12-02 22:38:30 +01:00
Freddy Vulto
048e27bf28 Merge branch 'master' of git+ssh://fvu-guest@git.debian.org/git/bash-completion/bash-completion 2009-12-02 21:15:50 +01:00
Freddy Vulto
c920661b5e (testsuite) Fix ssh test with colon completions
Function `assert_complete()' is becoming hairy but let's wait untill
other completions with other special characters come along before
refactoring.
2009-12-02 21:12:40 +01:00
Ville Skyttä
ab74bd4da9 Redirect dcop/qdbus stderr to /dev/null.
Even if we have e.g. dcop installed we may not have dcopserver running
and providing completions.
2009-11-30 23:16:08 +02:00
Ville Skyttä
a6f79a9a69 Add jarsigner, pack200, and unpack200 completions. 2009-11-30 23:01:32 +02:00
Ville Skyttä
911f3859c8 Turn on -o filenames in _filedir() if compopt is available. 2009-11-30 22:54:07 +02:00
Ville Skyttä
754ee95c1c Drop some unnecessary echos and greps. 2009-11-29 17:16:17 +02:00
Freddy Vulto
a07b5c5ffd Fix expanding quoted tilde in _known_hosts_real.
- Added unit test "Files starting with tilde (~) should work" to
  unit/_known_hosts_real.exp
2009-11-29 14:42:42 +01:00
Freddy Vulto
511b7c7f35 (testsuite) Fix `assert_complete_partial()'
Make sure items are unique before assembling list of completions.
2009-11-29 14:40:46 +01:00
Freddy Vulto
1064bb1c14 Removed array parameter expansion
The testsuite failed on _known_hosts_real on bash-3.  After long searching, it
appears that on bash-3 (not bash-4) array expansion with a modified IFS causes
the array to merge into a single item (!).  See also:

   http://www.mail-archive.com/bug-bash@gnu.org/msg06520.html

The effect was that multiple UserKnownHostsFiles in one config file weren't
detected properly.
The faulting parameter expansion ("${tmpkh[@]//\"/}) actually isn't necessary
anymore, since eval is done now, so it is removed.
2009-11-28 17:44:33 +01:00
Freddy Vulto
0209fbde2c (testsuite) Detailed _known_hosts_real test for consecutive spaces 2009-11-28 17:35:01 +01:00
Ville Skyttä
e24f69aac3 Fix ssh -m completion. 2009-11-28 12:47:48 +02:00
Ville Skyttä
97e3778cb2 Code cleanups, indentation and line wrapping fixes, comment improvements. 2009-11-28 12:47:48 +02:00
Ville Skyttä
c948a3d411 Reuse "esc" more in scp escaping. 2009-11-28 12:47:48 +02:00
Ville Skyttä
3a44188d52 Fix scp completion for paths containing other backslash escaped chars besides spaces. 2009-11-28 12:47:48 +02:00
Ville Skyttä
ff0f741dcf Fix completion of remote scp filenames with spaces.
Backslash escaping adds 3 backslashes, of which we want to remove 2,
not 4 when unescaping.
2009-11-28 12:47:48 +02:00
David Paleino
3191d14a55 Wrap lines 2009-11-28 11:06:11 +01:00
David Paleino
ea2a5d2aed Fix errors in the asciidoc ([[]] indicates a template in asciidoc) 2009-11-28 11:05:36 +01:00
Ville Skyttä
487088e1d2 Weed out duplicate known hosts files to check.
https://bugzilla.redhat.com/show_bug.cgi?id=541423#c4
2009-11-26 23:49:32 +02:00
Ville Skyttä
76de7c2984 Fix handling of known hosts files starting with ~.
https://bugzilla.redhat.com/show_bug.cgi?id=541423#c3

Done by adding the eval back.  The only thing that this breaks AFAIK
is handling of known hosts filenames that have more than one
consecutive space in them, but I couldn't figure out how to get both
to work and IMO support for files starting with ~ is much more
important.
2009-11-26 23:30:04 +02:00
Ville Skyttä
6f921d563b Fix reading rest of user/global known hosts files when the first one is not readable.
https://bugzilla.redhat.com/show_bug.cgi?id=541423#c2

As a side effect, this simplifies things somewhat and grabs user and
global known hosts filenames from config files with one command
instead of doing one for each.
2009-11-26 21:59:12 +02:00
Freddy Vulto
a9717be57b (testsuite) Moved location of making-list-unique
Moved making-expected-list-unique out of `match_items()' & `get_hosts()'
into `assert_complete()' because the former are low level functions and
items need not necessarily be unique.  They only need to be unique when
we're actually testing *completions*.
2009-11-25 22:31:29 +01:00
Freddy Vulto
8c94bf6944 (testsuite) Fix superfluous `&&' in get_hosts_avahi() 2009-11-25 21:47:58 +01:00
Ville Skyttä
032483036f Avoid extended globbing in case labels per current style guidelines. 2009-11-23 20:16:30 +02:00
Ville Skyttä
b424bfe37b Use [[ ]] when appropriate per current style guidelines. 2009-11-23 20:08:52 +02:00
Ville Skyttä
29baa6b720 Fix modprobe -r completion when a path to modprobe is specified. 2009-11-23 17:32:48 +02:00
Ville Skyttä
ef025a78ab Try to install/test arch completion only for the mailman one, not coreutils/util-linux-ng. 2009-11-23 00:29:16 +02:00
Freddy Vulto
4230265870 Fix completion of filenames containing colon.
This fixes the auto tests for `finger' and `ssh' on machines where an IPv6 host
"::1" is mentioned in /etc/hosts.
Added helper function __ltrim_colon_completions.

To run the tests:

    ./runCompletion finger.exp ssh.exp
2009-11-22 22:22:35 +01:00
David Paleino
8f42adfa8d Style policy: don't use fancy globbing in case labels 2009-11-22 11:43:26 +01:00
Freddy Vulto
1eb6c14ac1 fix typo in undoing cpio globbing 2009-11-22 09:30:22 +01:00
David Paleino
87fbdc9c18 contrib/cpio: don't use globbing, as per new team policy 2009-11-22 08:33:00 +01:00
David Paleino
14e373d3f1 Remove generated HTML documentation, add it to gitignore 2009-11-22 08:30:16 +01:00
David Paleino
9a8fb49fe4 contrib/cpio: added missing completions for -?, --help, --license, --usage, --version and (-p) --to-stdout (Debian: #557436) 2009-11-22 08:22:58 +01:00
David Paleino
29f4b10890 Added colordiff completion, same as diff 2009-11-21 14:38:41 +01:00
Freddy Vulto
75969454c0 (testsuite) Make expected lists unique 2009-11-21 10:18:54 +01:00
Ville Skyttä
08c51bccbd Add style guide items for case label globbing and [[ ]] vs [ ]. 2009-11-20 22:54:44 +02:00
Freddy Vulto
2a506ec3f7 (testsuite) Set TERM=dummy only for non-cron
Err, TERM=linux also causes errors when tests are run via cron.
Reset TERM=dummy.
Workaround is to do a CRON=running from within the cron job and only set
TERM=dummy when not run via cron.
2009-11-18 23:45:16 +01:00
Ville Skyttä
2888874fa9 Testsuite: don't use pidof to check if avahi-daemon is running, cf. commit bb8912b06ff09f8fed253e7e5b14916e38a48733. 2009-11-18 23:33:06 +02:00
Freddy Vulto
1bb351e227 (testsuite) Set TERM=linux
The TERM=dummy setting causes backspaces (^H) to appear in stdout when running
from cron.  Changing to TERM=linux should fix the ^H's in stdout AND the bug of
`meta_on' or `meta_off' escape sequences in stdout, caused by a bug in
supposedly libreadline5:

http://old.nabble.com/-PATCH-:-fix-libreadline5-linked-applications-sending-meta_on-or-meta_off-to-stdout-td25557585.html

Steps to reproduce output of ^H with TERM=dummy:

    $ batch
    warning: commands will be executed using /bin/sh
    at> ./runUnit _known_hosts_real.exp --debug < /dev/tty40
    at> ^D

NOTE: You need to connect a terminal (< /dev/tty..) to the test suite
      when running from cron.  See also doc/testing.txt, "Running tests via
      cron".
2009-11-15 21:51:46 +01:00
Ville Skyttä
571e2fb7e1 Testsuite: avoid readline escape junk at beginning of line.
See e.g. http://bugs.gentoo.org/246091
2009-11-10 20:45:59 +02:00
Freddy Vulto
8a80987373 (testsuite) Improved removing cword from cmd
- Refactored code to new function `_remove_cword_from_cmd()'
- Added `cword' parameter to `assert_complete()' and `assert_complete_dir()':

    @param string $cword  (optional) Last argument of $cmd which is an
        argument-to-complete and to be replaced with the longest common
        prefix of $expected.  If empty string (default), `assert_complete'
        autodetects if the last argument is an argument-to-complete by
        checking if $cmd doesn't end with whitespace.  Specifying `cword'
        is only necessary if this autodetection fails, e.g.  when the last
        whitespace is escaped or quoted, e.g. "finger foo\ " or
        "finger 'foo "
2009-11-07 09:57:11 +01:00
Freddy Vulto
573844daa2 (testsuite) Test lftpget only if available 2009-11-07 09:28:14 +01:00