1313 Commits

Author SHA1 Message Date
Ville Skyttä
43681ffac6 Make _parse_help() look at stderr too. 2010-01-18 19:09:02 +02:00
Ville Skyttä
df1a02baa5 Add pigz and unpigz completion. 2010-01-18 18:54:39 +02:00
Freddy Vulto
2f78769d65 Removed awk regexp character classes.
On Debian/Ubuntu, awk (mawk 1.3.3 Nov 1996) is not supporting regexp
character classes.  See also:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314323

This was causing unit test `_known_hosts_real' to fail.  To run the
test:

    ./run unit/_known_hosts_real.exp
2010-01-17 10:41:13 +01:00
Ville Skyttä
f8eec776e2 Weed out look completions not starting with current word.
Some versions of the default word list for look may return
non-completable entries (e.g. due to sort order mismatch -- dictionary
vs non-dictionary one, case sensitivity etc -- between sort order in
default word list and look's defaults).  As a side effect, fixes also
the test case when a lot of words are returned.
2010-01-16 17:30:02 +02:00
Ville Skyttä
ea0ee6a46b Fix installing simple xspec completions on systems with non-GNU sed.
There's no alternation functionality ('\|' or '|') in POSIX BRE.
2010-01-16 15:38:49 +02:00
Ville Skyttä
878c9dd5c9 Fix finding known hosts files from SSH configs on systems with non-GNU sed.
There's no alternation functionality ('\|' or '|') in POSIX BRE.
2010-01-16 15:22:49 +02:00
Ville Skyttä
1fe72c982e Update years in copyright notice. 2010-01-14 19:33:21 +02:00
Ville Skyttä
dfc8e9bb8f Apply xine and friends completion also to dragon. 2010-01-13 20:36:01 +02:00
Freddy Vulto
d5d7592169 Fix _known_hosts_real: awkcurd > curd 2010-01-06 09:31:31 +01:00
Ville Skyttä
db739401f7 sed portability fixes.
Use \{0,1\} (POSIX BRE) instead of \? or empty subexpression alternatives.
2010-01-04 18:15:10 +02:00
Ville Skyttä
2a5a1d68d9 Fix some syntax errors.
For some reason, these constructs got flagged as syntax errors at load
time with bash 4.0.33(0)-release on FreeBSD 8.0 whereas they work
elsewhere I've tested (e.g. 4.0.23(1)-release on Fedora Core 11).
2010-01-03 21:18:41 +02:00
Guillaume Rousse
2cf62de308 protect against error when used in history context (COMP_CWORD=0) 2010-01-03 19:01:56 +01:00
Ville Skyttä
aae256d7e0 Do basic HTML file completion with Firefox and Chrome and friends, and Epiphany. 2010-01-03 14:21:08 +02:00
Ville Skyttä
9c2843a956 Remove/rephrase some obsolete bash 2 related comments. 2010-01-03 14:03:38 +02:00
Ville Skyttä
86070a8f60 Fix __expand_tilde_by_ref usage example. 2010-01-03 13:50:14 +02:00
Ville Skyttä
563e4d355d Split mount and umount completion into contrib/mount. 2010-01-02 10:35:18 +02:00
Freddy Vulto
3f0bfbc5ae Fix __reassemble_comp_words_by_ref()
Completing "a b " returned cur=b instead of cur=nothing if a wordbreak
character was specified.
2009-12-31 11:12:15 +01:00
Freddy Vulto
3251038c9d Fix __reassemble_comp_words_by_ref()
On bash-3, completing a b c: with COMP_WORDBREAKS -= : would result in the
current word being bc: (Alioth #312190)

Added unit test, run via:

    ./run unit/_get_cword.exp
2009-12-30 09:43:16 +01:00
Ville Skyttä
eee39d7b66 Re-fix *.okular addition, this time without matching compressed ones. 2009-12-28 23:50:24 +02:00
David Paleino
8299cd3616 Revert "Fix *.okular addition."
This reverts commit dd5134a39a25f967cbc020b8a4d15807a2f5028e.

  Okular doesn't open compressed .okular files.
2009-12-28 21:28:16 +01:00
Ville Skyttä
dd5134a39a Fix *.okular addition. 2009-12-28 22:25:47 +02:00
David Paleino
db3c386fd3 Added .okular completion to okular (Debian: #545530) 2009-12-27 19:07:24 +01:00
Ville Skyttä
8f56de625e Fix $2 example in _get_cword doc. 2009-12-24 15:31:19 +02:00
Freddy Vulto
c9c98da36e Fixed `quote_readline'.
This fixes completing filenames containing single quote (') on bash-4.

Also added emulation of `-o filenames' to _filedir.

Added tests for _filedir.

Fixed array assignment within __reassemble_comp_words_by_ref().
2009-12-24 10:00:29 +01:00
Ville Skyttä
3d9f8206e1 Use awk more to reduce number of invoked commands a bit. 2009-12-21 23:00:31 +02:00
Ville Skyttä
6807b5e72d Replace some echos with printfs. 2009-12-21 00:09:02 +02:00
Ville Skyttä
c755d7becc Replace some uses of ls with printf. 2009-12-20 23:44:33 +02:00
Ville Skyttä
8caddc47cf Protect grep invocations from user aliases (Alioth: 312143). 2009-12-15 23:48:10 +02:00
Ville Skyttä
5d691d4826 Complete aliases also when there are no known hosts files (RedHat: #546905). 2009-12-13 11:41:55 +02:00
Ville Skyttä
a358902e90 Include avahi host completions in known hosts completions no matter if we have known hosts or ssh config files or not. 2009-12-13 11:33:54 +02:00
Ville Skyttä
b72a0f6e26 Get rid of one unnecessary local variable. 2009-12-13 11:31:06 +02:00
Ville Skyttä
798bd2328e Doc and line wrapping fixes. 2009-12-13 11:28:14 +02:00
David Paleino
bf1d64153f Added .fdf completion to okular and evince 2009-12-11 17:49:23 +01:00
Ville Skyttä
733811a7b1 Don't append space after colon in _usergroup (bash 4 only). 2009-12-11 00:39:59 +02:00
Ville Skyttä
8f68300a0d Add wordbreak filtering to _count_args. 2009-12-11 00:14:54 +02: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
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
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
Ville Skyttä
911f3859c8 Turn on -o filenames in _filedir() if compopt is available. 2009-11-30 22:54:07 +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
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
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
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
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
29f4b10890 Added colordiff completion, same as diff 2009-11-21 14:38:41 +01:00
Ville Skyttä
36eb06af6b Extract CD/DVD completion from k3b into general functions, use them in mplayer. 2009-11-04 23:12:44 +02:00