1986 Commits

Author SHA1 Message Date
Ville Skyttä
b8ffa2dc48 Add some unit tests for _count_args. 2009-12-11 00:14:02 +02:00
Ville Skyttä
d1da93448f Comment spelling fixes. 2009-12-10 23:53:22 +02:00
Freddy Vulto
0529d738d2 Fix perl completion by removing : from wordbreaks
Specify colon (:) to be excluded as word separator character when doing
_get_cword().
2009-12-10 21:35:53 +01:00
Freddy Vulto
bc9e37a39c Merge branch 'master' of git+ssh://fvu-guest@git.debian.org/git/bash-completion/bash-completion 2009-12-10 21:29:48 +01:00
Freddy Vulto
b1e58b1a0e Fix __reassemble_comp_words_by_ref()
If a word is made up of multiple word separator characters:

   $ a b::<TAB>  # CWORDS are: a, b, and :: (correct)

__reassemble_comp_words_by_ref() couldn't handle this.  It assumed CWORDS were:

   $ a b::<TAB>  # CWORDS: a, b, : and : (but they're not)

Added test case for this.  To run the automated tests:

   ./runUnit _get_cword.exp
2009-12-10 21:28:24 +01:00
Ville Skyttä
69aa25cd8f Add pm-utils completion. 2009-12-10 22:00:52 +02:00
Ville Skyttä
0f25d9c66f Use sort -u instead of sort | uniq where appropriate. 2009-12-09 23:55:45 +02:00
Freddy Vulto
cbf7e1f963 Merge branch 'master' of git+ssh://fvu-guest@git.debian.org/git/bash-completion/bash-completion 2009-12-09 22:17:02 +01:00
Freddy Vulto
6fe53ef0e6 Fixed completing perl modules containing colons
The solution for bash-4 is to remove the colon from COMP_WORDBREAKS:

   COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

The workaround for bash-3, or bash-4 with a colon in COMP_WORDBREAKS,
is to call:

  __ltrim_colon_completions "$cur"

after completions have been put in COMPREPLY.

See also: E13) Why does filename completion misbehave if a colon appears
in the filename? - Bash FAQ, http://tiswww.case.edu/php/chet/bash/FAQ
2009-12-09 22:13:56 +01:00
Ville Skyttä
98d439ea46 Use grep -E instead of deprecated egrep. 2009-12-09 22:52:00 +02:00
Ville Skyttä
04b7883f7d Use here strings instead of echos where appropriate (part of Alioth: #312143). 2009-12-09 22:46:09 +02:00
Ville Skyttä
09045a63b6 Add update-alternatives --set, --usage, and --slave completions, simplify some bits. 2009-12-09 21:26:12 +02:00
Ville Skyttä
d68c8e508a Indentation fixes. 2009-12-09 21:06:35 +02:00
Ville Skyttä
b4b4b37b96 Fix version in upstream availability comment. 2009-12-09 20:43:21 +02:00
Ville Skyttä
536a780c2e Drop short options from screen completions where long(er) ones exist, add --help and --version. 2009-12-09 01:06:47 +02:00
Ville Skyttä
21d0f70cb0 Use _shells in screen -s. 2009-12-09 01:01:49 +02:00
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