Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit a5ead3f

Browse files
committed
Updated CHANGELOG for 0.2.5
1 parent 7d61254 commit a5ead3f

File tree

2 files changed

+53
-57
lines changed

2 files changed

+53
-57
lines changed

CHANGELOG.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ py-bash-completion Change Log
44

55
.. current developments
66
7+
v0.2.5
8+
====================
9+
10+
**Fixed:**
11+
12+
* bash_completions to include special characters in lprefix
13+
14+
Previously, glob expansion characters would not be included in lprefix for replacement
15+
16+
.. code-block:: sh
17+
18+
$ touch /tmp/abc
19+
$ python
20+
>>> from bash_completion import bash_completions
21+
>>>
22+
>>> def get_completions(line):
23+
... split = line.split()
24+
... if len(split) > 1 and not line.endswith(' '):
25+
... prefix = split[-1]
26+
... begidx = len(line.rsplit(prefix)[0])
27+
... else:
28+
... prefix = ''
29+
... begidx = len(line)
30+
... endidx = len(line)
31+
... return bash_completions(prefix, line, begidx, endidx)
32+
...
33+
>>> get_completions('ls /tmp/a*')
34+
({'/tmp/abc '}, 0)
35+
36+
Now, lprefix begins at the first special character:
37+
38+
.. code-block:: sh
39+
40+
$ python
41+
>>> from bash_completion import bash_completions
42+
>>>
43+
>>> def get_completions(line):
44+
... split = line.split()
45+
... if len(split) > 1 and not line.endswith(' '):
46+
... prefix = split[-1]
47+
... begidx = len(line.rsplit(prefix)[0])
48+
... else:
49+
... prefix = ''
50+
... begidx = len(line)
51+
... endidx = len(line)
52+
... return bash_completions(prefix, line, begidx, endidx)
53+
...
54+
>>> get_completions('ls /tmp/a*')
55+
({'/tmp/abc '}, 7)
56+
57+
58+
59+
760
v0.2.4
861
====================
962

news/fix-lprefix-computation.rst

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)