1394 Commits

Author SHA1 Message Date
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
Ville Skyttä
db7d2833df Indentation/linewrap fixes. 2009-11-04 00:24:28 +02:00
Ville Skyttä
41c675e749 sed usage portability fixes: avoid semicolon separated statements in one -e. 2009-11-04 00:16:06 +02:00
Ville Skyttä
ef46331012 Fix service argument completion. 2009-11-03 23:36:01 +02:00
Ville Skyttä
5b54c41de5 Fix javadoc, lvm, and mkinitrd (_count_args) local variable leaks. 2009-11-03 22:49:14 +02:00
Ville Skyttä
c820944d2e Be stricter when finding long options in _longopt. 2009-11-03 22:28:10 +02:00
Ville Skyttä
4790b1a0c6 sed usage portability fixes: avoid \+ 2009-11-03 22:04:46 +02:00
Ville Skyttä
ac644578e0 More compgen -W instead of embedding user input in sed/awk/grep fixes. 2009-11-01 21:01:18 +02:00
Ville Skyttä
f1b3be2357 Drop compgen/complete option and bash version related global variables. 2009-10-31 14:40:24 +02:00
Ville Skyttä
82c2334e4c Add /sbin to $PATH when invoking ifconfig and iwconfig. 2009-10-31 14:05:19 +02:00
Freddy Vulto
884c3f5af6 Fixes to _get_pword patch.
Changed the last `echo' to a `printf' to make completing `-n' or '-e'
come through.  Declaring a function local (break_index & word_start)
also doesn't work on my machine: the functions become visible global.  I
considered doing an unset -f at the end of __get_cword4, but I made them
global (__break_index & __word_start) because they're used so often.
2009-10-31 09:55:40 +01:00
Freddy Vulto
545750eb2c Added _get_pword() helper function.
Thanks to Sung Pae (Alioth #312030):
"This patch extends both __get_cword3() and __get_cword4() to accept an
additional integer argument that specifies how many places previous to
the current word the desired word resides, respecting any user
exceptions to COMP_WORDBREAKS."
2009-10-31 09:24:20 +01:00
Ville Skyttä
eb5e62dec1 Drop internal uses of $bash4 (definition still present though). 2009-10-22 12:10:34 +03:00
Ville Skyttä
885e6dd6b6 Drop internal uses of $default, $filenames and friends.
Definitions are still present though, tentatively scheduled for
removal as of 2.0.
2009-10-22 12:04:29 +03:00
Ville Skyttä
f194a2d753 bash < 3 support removal step 4: drop unneeded version checks. 2009-10-22 11:50:20 +03:00
Ville Skyttä
a6cf003275 Set version to 2.x. 2009-10-22 11:17:10 +03:00
Ville Skyttä
6862bb45c1 bash < 3 support removal step 1: drop unneeded conditional sections. 2009-10-22 11:15:27 +03:00
Ville Skyttä
bc6ad9b75b Source stuff from completion dirs always in same order independently of locale. 2009-10-21 20:44:19 +03:00
Ville Skyttä
cbd15cc8a0 Don't bother defining __get_cwordX on non-applicable bash versions. 2009-10-20 22:22:47 +03:00
Ville Skyttä
1ce1e0d452 Don't overwrite other completions when completing from multiple SSH known hosts files. 2009-10-20 20:05:30 +03:00