Skip to content

Commit 2282395

Browse files
committed
Add tab completion support with argcomplete
1 parent 9eccf3c commit 2282395

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

gitless/cli/gl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import sys
1111
import argparse
12+
import argcomplete
1213
import traceback
1314
import pygit2
1415

@@ -101,7 +102,7 @@ def main():
101102
gl_switch, gl_init, gl_history]
102103

103104
parser = build_parser(sub_cmds, repo)
104-
105+
argcomplete.autocomplete(parser)
105106
if len(sys.argv) == 1:
106107
print_help(parser)
107108
return SUCCESS

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# make sure to update setup.py
22

3+
argcomplete>=1.11.1
34
pygit2==1.1.1 # requires libgit2 0.99 or 1.0
45
clint==0.5.1
56
sh==1.12.14;sys_platform!='win32'

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
# make sure it matches requirements.txt
7171
'pygit2==1.1.1', # requires libgit2 0.99 or 1.0
7272
'clint>=0.3.6',
73-
'sh>=1.11' if sys.platform != 'win32' else 'pbs>=0.11'
73+
'sh>=1.11' if sys.platform != 'win32' else 'pbs>=0.11',
74+
'argcomplete>=1.11.1'
7475
],
7576
license='MIT',
7677
classifiers=[

0 commit comments

Comments
 (0)