Add bash autocomplete code.
Add bash autocomplete code based on the argcomplete package. The file 'bash_completion/hpgit' should be copied in '/etc/bash_completion.d/' but this require root priviledges. Change-Id: I2c6133a0d9677d6f91fd6c96ceb4e84eda3c75ac JIRA: CICD-261
This commit is contained in:
1
bash_completion/hpgit
Normal file
1
bash_completion/hpgit
Normal file
@@ -0,0 +1 @@
|
||||
eval "$(register-python-argcomplete git-hp)"
|
@@ -24,6 +24,7 @@ import ghp.version
|
||||
import subcommand
|
||||
import argparse
|
||||
from argparse import ArgumentParser
|
||||
import argcomplete
|
||||
import logging
|
||||
import sys
|
||||
|
||||
@@ -92,6 +93,7 @@ def main(argv):
|
||||
help(parser, argv)
|
||||
return 0
|
||||
|
||||
argcomplete.autocomplete(parser)
|
||||
args = parser.parse_args()
|
||||
if args.func == help:
|
||||
help(parser, args, cmds)
|
||||
|
1
git-hp
1
git-hp
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
#PYTHON_ARGCOMPLETE_OK
|
||||
#
|
||||
# Copyright (c) 2012 Hewlett-Packard
|
||||
#
|
||||
|
2
setup.py
2
setup.py
@@ -33,7 +33,7 @@ setup(
|
||||
url="https://wiki.hpcloud.net/display/auto/hpgit",
|
||||
scripts=['git-hp'],
|
||||
packages=find_packages(exclude=['test']),
|
||||
install_requires=['GitPython'],
|
||||
install_requires=['GitPython','argcomplete'],
|
||||
long_description=read('README'),
|
||||
classifiers=[
|
||||
"Development Status :: 2 - Pre-Alpha",
|
||||
|
Reference in New Issue
Block a user