1426 Commits

Author SHA1 Message Date
Ville Skyttä
0ceca807c5 Add *.apk to unzip and jar filename completions. 2010-12-16 19:59:41 +02:00
Ville Skyttä
c5957792ab Turn on -o filenames in _command_offset() for completions that specify it.
We don't need to do "complete -o filenames ..." when installing
bash-completion completions any longer (they should be handled
"internally"), but there are external completions which do that and
need it in effect also when completing with nice, sudo and friends.
2010-12-13 21:33:46 +02:00
Ville Skyttä
c81b87fbd3 Make _command_offset() do the right thing with full path completions.
For example, "sudo /usr/sbin/useradd" completion didn't work properly,
whereas "sudo useradd" did.
2010-12-04 21:07:03 +02:00
Ville Skyttä
6934a508ef Test for availability of compopt before invoking it in _compopt_o_filenames().
Invoking it there on bash < 4 may cause terminal echo to be turned off for
some weird reason (RedHat: #653669).
2010-11-16 21:09:23 +02:00
Ville Skyttä
8f0055553b Add/improve various autotools completions. 2010-11-12 21:56:40 +02:00
Freddy Vulto
dfb84064a4 Fix _tilde with new _compopt_o_filenames 2010-11-03 19:55:38 +01:00
Ville Skyttä
0f450219b6 Remove most "-o filenames" options to "complete".
Turn it on dynamically when needed instead; see doc/styleguide.txt for
a longer explanation.  This fixes many non-filename completions which
had been previously more or less broken due to unwanted
escape-as-filenames behavior.
2010-11-01 19:29:45 +02:00
Ville Skyttä
a877567477 Improve relevance of many user/group completions, depending on context.
_usergroup now has a -u option, and there are new _allowed_users and
_allowed_groups helpers.  These can be used to limit returned users
and/or groups to ones that the user has access to (or should be
assumed to have access to if running a "root command").

I had to remove a couple of "funky user" chown test cases because for
some reason they were broken by this change, I didn't immediately find
out why, and I couldn't come up with a valid use case that should be
supported for them that would be more beneficial than the relevance
improvements in this patch.
2010-10-31 21:28:44 +02:00
Ville Skyttä
9093ae293b Expose root command name from _root_command, add _complete_as_root helper. 2010-10-31 20:26:32 +02:00
Ville Skyttä
48438b2061 Move "compopt -o filenames" kludge to _compopt_o_filenames for easier reuse. 2010-10-31 20:14:56 +02:00
Ville Skyttä
f4c5d0c596 Add *.iso to mplayer, kaffeine, and dragon filename completions (Alioth: #311420).
xine-ui doesn't seem to support direct opening of *.iso files, so
split it and fbxine and aaxine from kaffeine and dragon completions.
2010-10-31 19:29:52 +02:00
Ville Skyttä
7d45595493 Complete known hosts from avahi-browse only if $COMP_KNOWN_HOSTS_WITH_AVAHI is non-empty.
This effectively turns off avahi-browse by default; doing it by
default is not worth it compared to the number of various (mostly
slowness) problems it has caused people, for example Alioth #312691
and RedHat #630326.

Mandriva has applied a similar patch for some time already, although
their environment variable name was different ($COMP_AVAHI_BROWSE).
2010-10-25 21:47:33 +03:00
Ville Skyttä
81b916effc Sort _command and _root_command targets. 2010-10-24 22:04:12 +03:00
Ville Skyttä
edd22493fe Add sha{,224,256,384,512}sum _longopt completions. 2010-10-24 22:01:50 +03:00
Ville Skyttä
82c5d5e2ef Sort _longopt targets. 2010-10-24 21:58:03 +03:00
Ville Skyttä
90f3b3dda0 Drop simple id completion, more thorough one is in completions/coreutils. 2010-10-24 21:54:13 +03:00
Ville Skyttä
b9b807e168 Drop simple passwd completion, more thorough one is in completions/shadow. 2010-10-24 21:43:48 +03:00
Ville Skyttä
5d7a13e05b Complete MAC addresses also from /etc/ethers. 2010-10-23 22:32:06 +03:00
Ville Skyttä
1b248b5502 Make mkdir complete only on dirs. 2010-10-23 14:36:11 +03:00
Ville Skyttä
d51ad46cd2 Improve _longopt --*=, --*dir*, --*file*, and --*path* completions. 2010-10-23 14:27:15 +03:00
Ville Skyttä
768bbc7858 Turn on -o filenames automatically also with _filedir -d. 2010-10-23 14:17:49 +03:00
Ville Skyttä
57720ee0be Treat --*path* like --*file* in _longopt(). 2010-10-23 14:15:32 +03:00
Ville Skyttä
245486b6df Add *.m2t and *.m2ts to xine-based player filename completions (Alioth: #312770). 2010-10-17 22:17:38 +03:00
Andrey G. Grozin
13e811b1f9 Add *.fb2 to okular filename completions. 2010-10-13 18:44:47 +03:00
Ville Skyttä
96c6416309 Make _parse_help() work with slash separated options. 2010-10-11 00:39:50 +03:00
Ville Skyttä
52bfcefb3d Simplify _parse_help somewhat. 2010-10-11 00:38:55 +03:00
Ville Skyttä
95399f638c Fix false posives for non-option words in _parse_help (Alioth: #312750, Stephen Gildea). 2010-10-11 00:01:51 +03:00
Ville Skyttä
cb6a9a4dfe Use "compgen -f" hack from _cd() instead of emulating -o filenames in _filedir().
See http://bugs.debian.org/272660#64 for more info about the hack.
2010-10-07 20:39:10 +03:00
Ville Skyttä
96b1594e4e Use "compopt -o filenames" if available instead of "compgen -f" hack in _cd(). 2010-10-07 20:37:06 +03:00
Ville Skyttä
4cd7c7c872 Treat *.spm as *.src.rpm.
Source rpms are sometimes named *.spm, e.g. in SUSE.
2010-10-07 20:05:55 +03:00
Ville Skyttä
27dab7e198 Allow setting option for creating output to parse in _parse_help().
Required in just added sysbench completion.
2010-10-06 00:01:00 +03:00
Freddy Vulto
e8d84b3004 Bugfix __reassemble_comp_words_by_ref
a b:c |<TAB> (with |=cursor) did not return `b:c' as `prev' on bash-4.1
(Alioth #312740)
2010-10-05 21:39:58 +02:00
Ville Skyttä
1da64f602a More known hosts IPv6 completion fixes, thanks to Yoshinori KUNIGA.
https://bugzilla.redhat.com/show_bug.cgi?id=630658#c4
2010-10-04 21:31:03 +03:00
Ville Skyttä
3d8efed618 Fixes to completions for filenames containing tabs (RedHat: #629518). 2010-10-04 20:49:17 +03:00
Ville Skyttä
66e35aa4a1 Use awk sub instead of gsub where appropriate. 2010-09-28 18:29:26 +03:00
Ville Skyttä
9341a1131c Fix known hosts completion for IPv6 addresses whose last 16 bits are digits (Alioth: #312695, RedHat: #630658). 2010-09-28 18:24:35 +03:00
Ville Skyttä
7ea7d7b268 Simplify filename completions per new _filedir(_xspec) uppercasing behavior. 2010-09-19 12:29:29 +03:00
Ville Skyttä
c183a585b2 Match uppercased versions of _filedir and _filedir_xspec arguments too.
This provides a bit of case insensivity to file extension matching,
allowing for example _filedir foo to match both *.foo and *.FOO.  Note
that this is not real case insensivity; mixed case extensions like
*.FOO.gz are not matched by _filedir foo.gz so those need to be
handled like before this change.
2010-09-19 12:12:06 +03:00
Ville Skyttä
8e23895fe5 Avoid stderr output from compopt when invoking _filedir directly.
The _filedir unit test currently does this, causing (harmless) error output.
2010-09-19 11:33:52 +03:00
Ville Skyttä
d2a551fad4 Combine identical xdvi and kdvi completions. 2010-09-18 20:51:51 +03:00
Ville Skyttä
0f426b0774 Drop bad kompare filename completion (Alioth: #312708). 2010-09-13 21:25:21 +03:00
Guillaume Rousse
ff6172097d symlinks are automatically dereferenced for -f test, so don't use -h test 2010-09-12 16:38:59 +02:00
Ville Skyttä
fa04cb8114 Add *.part to mplayer and xine-based player completions (Alioth: #312657). 2010-08-20 14:09:28 +03:00
Freddy Vulto
e846d84ed1 Fix _filedir to redirect only stderr 2010-08-20 11:28:19 +02:00
Freddy Vulto
b867bcd64f Fix _filedir error message on bash-3
In case of `sudo cmd', _filedir might be triggered for a cmd not having a
complete command, hence `complete -p cmd' could yield an error. (Alioth
2010-08-18 23:01:26 +02:00
Guillaume Rousse
9b97b40c4a don't source Makefiles when run from test suite 2010-08-16 21:17:51 +02:00
Ville Skyttä
ff7c17e599 Trivial cleanups. 2010-07-01 20:21:35 +03:00
Freddy Vulto
66d3b63915 Speed up `compopt' availability detection.
Used `type compopt' instead of `compopt' to detect availability of
compopt because (at least on Ubuntu) a python-command-not-found handler
is started when issuing a non-existing command, thus resulting in
considerable slower completions on systems without compopt (bash < 4.0).
2010-06-30 23:40:13 +02:00
Freddy Vulto
ccbf141e13 Fix tilde (~) completion with _filedir
This fixes tilde completion when doing for instance `ls ~<TAB>'.  See
also: Alioth #312613.

Added _tilde() helper function.

Contrary to _expand() and __expand_tilde_by_ref(), _tilde() also leaves the
tilde (~) intact.  Replacement of the tilde has been a complaint in other
bugreports, especially since plain bash completion (without bash-completion
installed) doesn't expand the tilde when doing a `ls ~<TAB>'.

To run the tests:

    ./run completion/ls.exp
    ./run unit/_tilde.exp
2010-06-30 23:28:31 +02:00
Ville Skyttä
6571c6685c Add sqlite3 option completions, include *.db in filename ones (Alioth: 312605). 2010-06-29 19:30:32 +03:00