Ville Skyttä
622d2bd25f
_longopt: Use \{0,1\} instead of \? for sed (basic regex) portability.
2011-05-08 15:30:37 +03:00
Ville Skyttä
727fa3adfd
modplug*: Add more extensions for files supported by libmodplug.
2011-05-08 15:17:52 +03:00
Ville Skyttä
3334711726
_parse_usage: Deal with whitespace in brackets.
2011-05-05 00:06:58 +03:00
Ville Skyttä
cec611fa51
_parse_help: Use -r to "read" to avoid backslash issues.
2011-05-04 22:45:47 +03:00
Ville Skyttä
1c76e608fd
__parse_options: Return 0 to avoid false negatives from _parse_* test cases.
2011-05-03 09:35:53 +03:00
David Paleino
4632248cbb
Get rid of $BASH_COMPLETION as well
2011-05-02 19:04:24 +02:00
David Paleino
43728af423
Get rid of BASH_COMPLETION_DIR and BASH_COMPLETION_HELPERS_DIR
2011-05-02 18:37:49 +02:00
David Paleino
5961c3b8cd
Layout change: everything is now in /usr/share/bash-completion/, rather than in /etc/.
2011-05-02 17:01:23 +02:00
Ville Skyttä
dd59b49f25
_init_completion: Doc update.
2011-05-02 14:37:33 +03:00
Ville Skyttä
457dbf6061
_init_completion: Indicate that completion should not continue if cword == 0.
...
http://thread.gmane.org/gmane.comp.shells.bash.bugs/16499
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2011-May/003635.html
Thanks-to: Igor Murzov <igor@gplsoft.org>
2011-05-02 14:37:33 +03:00
Ville Skyttä
68f6f1c685
_parse_usage, _parse_help: Add _parse_usage, expand [no-] and [dont-?] as well in _parse_help.
2011-05-02 14:37:13 +03:00
Ville Skyttä
c875723bef
Include trailing equals sign in options that take arguments that way.
...
This way it's clearer to users that an argument is expected. It's
likely that this commit does not catch all such cases, but it should
do it for most of the affected commands I have installed.
2011-05-02 11:45:55 +03:00
Ville Skyttä
288c1eb3c1
_parse_help: Fix handling of commands with paths.
...
Regression from commit a614028a9b7e22b76f609a49dc7cfc2b8ad0abcd, need to
eval cmd before setting IFS to avoid it being split.
2011-05-02 10:40:36 +03:00
Ville Skyttä
a54857cd05
_init_completion: Add -s for splitting long options, use it in completions.
2011-05-02 00:04:26 +03:00
Igor Murzov
5c98d3160a
_init_completion: Fix out of bounds access to words when cword is 0.
2011-05-01 17:32:09 +03:00
Ville Skyttä
ddbd28f638
Comment fixes.
2011-05-01 17:29:43 +03:00
Ville Skyttä
a614028a9b
_parse_help: Implement in bash instead of awk.
...
It's more portable and maintainable this way, but also somewhat slower
(but not slower enough that it'd actually matter).
2011-05-01 14:24:29 +03:00
Ville Skyttä
8b45b345ce
_filedir*: Add link to bash-bug discussion about complete -X case sensitivity.
2011-05-01 12:39:13 +03:00
Ville Skyttä
2544b384ea
Add lbzip2, lbunzip2, and lbzcat completions, using corresponding bzip2 ones.
2011-04-29 12:32:49 +03:00
Ville Skyttä
7fb4e3137d
_parse_help: Don't treat tokens with more than two leading dashes as options.
2011-04-29 12:05:29 +03:00
Ville Skyttä
b6cdacf1f9
_parse_help: Expand --[no]foo to --foo and --nofoo.
2011-04-29 11:47:48 +03:00
Ville Skyttä
fd2bd342e0
_parse_help: Fix --foo={bar,quux} handling.
2011-04-28 20:48:48 +03:00
Ville Skyttä
9d810be86b
_parse_help: Make work with pipe separated options.
2011-04-27 23:22:03 +03:00
Ville Skyttä
92ff96417d
_parse_help: Fix handling of tildes and escaped chars in command.
2011-04-27 22:10:40 +03:00
Ville Skyttä
7b60fc6555
_parse_help: Re-fix --foo[=bar] handling.
2011-04-27 21:44:04 +03:00
Ville Skyttä
5cd5993211
_parse_help: Change to output first long option, or first short if not found.
...
Makes things more consistent with the rest of our option offerings.
2011-04-27 18:36:52 +03:00
Ville Skyttä
c5b771749b
Add _terms() and screen -T completion.
2011-04-25 15:49:06 +03:00
Ville Skyttä
3750aea95e
Remove stale comment.
2011-04-25 15:49:06 +03:00
Ville Skyttä
d4e177a6ab
Simplify $UNAME checks.
2011-04-25 12:54:55 +03:00
Ville Skyttä
095b5a02d2
Fix --foo[=bar] parsing in _parse_help().
2011-04-25 11:43:57 +03:00
Ville Skyttä
6e809d032c
Remove = from COMP_WORDBREAKS when using _split_longopt().
...
Without this, it does not do anything useful in bash >= 4.0.
2011-04-25 00:09:50 +03:00
Ville Skyttä
a0afe0959b
Try to figure out file/dir argument types from --foo=BAR in _longopt().
2011-04-24 20:17:34 +03:00
Ville Skyttä
e104424ff2
Turn on -o filenames in _tilde() only when it produces completions.
2011-04-24 20:09:02 +03:00
Ville Skyttä
0042c06204
Code cleanups.
2011-04-24 20:05:19 +03:00
Ville Skyttä
a87086b7d4
Turn off default compopt when completing dirs in _longopt().
...
Otherwise -o default kicks in in cases where we have no dir
completions and ends up completing files.
2011-04-24 19:54:50 +03:00
Ville Skyttä
9f45e81e65
Drop no longer needed _compopt_o_filenames().
...
Use compopt -o filenames directly instead.
2011-04-21 12:33:05 +03:00
Ville Skyttä
6589a0d61b
Drop support for bash < 4.1, clean up no longer needed low hanging cruft.
2011-04-21 12:20:59 +03:00
Ville Skyttä
955219bf69
Use _init_completion() in bash_completion.
2011-04-20 13:14:04 +03:00
Ville Skyttä
32dbe76784
Add _init_completion() for common completion initialization and generic redirection handling.
2011-04-20 13:11:09 +03:00
Ted Pavlic
2eb713ff76
Add *.dbj to (la)tex filename completions (RedHat: #678122 ).
2011-04-15 23:47:22 +03:00
David Paleino
4ad538ba1a
Fix __get_cword_at_cursor_by_ref: check for $index when completing with a cword+1 argument already present (Debian: #622383 )
2011-04-12 22:06:12 +02:00
Ville Skyttä
7c34b56267
Try both full path and basename completions for sudo etc (Alioth: #313065 ).
2011-04-12 20:28:08 +03:00
Ville Skyttä
ee43b22f9b
Use += to append to arrays and strings.
...
It's easier on the eye and faster than foo=( "${foo[@]}" ... ).
2011-04-06 20:39:21 +03:00
Ville Skyttä
d2707cf368
Try /usr/sbin before /sbin in have().
...
The former tends to have more executables so this should save some
stat() calls in some setups.
2011-04-05 22:44:04 +03:00
Ville Skyttä
4d3e9d092c
Add $_backup_glob for matching various backup files and reuse it.
...
Compared to the previous embedded/duplicated globs, this one
additionally treats *.orig and *.rej as backup files.
2011-04-01 20:22:10 +03:00
Matej Cepl
e10848b7e5
Complete oo{writer,impress,calc,draw} on LibreOffice FlatXML extensions (RedHat: #692548 ).
2011-03-31 22:46:58 +03:00
Ville Skyttä
61b91cb41b
Trivial code cleanup.
2011-03-29 23:29:51 +03:00
Freddy Vulto
7cd17ada11
Fix __reassemble_comp_words_by_ref() unquoted pattern removal
...
Commit 8227e76 was failing on these `chown' tests in bash-4.1:
FAIL: Check preserve special chars in funky\ user:Debia<TAB>
FAIL: Check preserve special chars in funky\.user:Debia<TAB>
FAIL: Check preserve special chars in fu\ nky.user:Debia<TAB>
FAIL: Check preserve special chars in f\ o\ o\.\bar:Debia<TAB>
FAIL: Check preserve special chars in foo\_b\ a\.r\ :Debia<TAB>
because a removal pattern is expanded:
$ a=\\b
$ w=\\
$ echo ${a#$w} # Doesn't work
\b
$ echo ${a#"$w"} # Ok
b
2011-03-27 22:08:55 +02:00
Freddy Vulto
8227e76e09
Improve __reassemble_comp_words_by_ref() (Alioth #313057 )
...
Prohibit word creation of characters if they're excluded from
$COMP_WORDBREAKS. For example, with ':' included in $COMP_WORDBREAKS,
'a b:' should split to 'b' and ':'. With ':' excluded from
$COMP_WORDBREAKS, 'a b:' should split to 'b:', NOT 'b' and ':'.
2011-03-24 00:00:58 +01:00
David Paleino
14fc9f2965
If _filedir 'ext' returns nothing, just fallback to generic file completion. Patch by Clint Byrum (Debian: #619014 , LP: #533985 )
2011-03-20 15:22:33 +01:00