Skip to content
Snippets Groups Projects
Commit 2c39e1c0 authored by Grant Miller's avatar Grant Miller
Browse files

Implement basic bash tab completion

If [argcomplete](https://argcomplete.readthedocs.io/en/latest/) is installed,
bash tab completion will be enabled for pmbootstrap's arguments.

If argcomplete is not installed, pmbootstrap continues to work as before.
parent de9e42ba
No related branches found
No related tags found
No related merge requests found
# PYTHON_ARGCOMPLETE_OK
"""
Copyright 2018 Oliver Smith
......
......@@ -459,6 +459,12 @@ def arguments():
help="force even if the file seems to be"
" invalid")
try:
import argcomplete
argcomplete.autocomplete(parser)
except ImportError:
pass
# Use defaults from the user's config file
args = parser.parse_args()
pmb.config.merge_with_args(args)
......
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
"""
Copyright 2018 Oliver Smith
......
......@@ -58,6 +58,9 @@ setup(
packages=find_packages(exclude=['aports', 'keys', 'test']),
tests_require=['pytest'],
cmdclass={'test': PyTest},
extras_require={
'argcomplete': ["argcomplete"],
},
entry_points={
'console_scripts': [
'pmbootstrap=pmb:main',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment