diff --git a/pmb/__init__.py b/pmb/__init__.py index a3b8cde5260403cfe495a43e97c01832dac1e6b8..c67d247de1f1b170723b06d9a715186a3d2bb145 100644 --- a/pmb/__init__.py +++ b/pmb/__init__.py @@ -1,3 +1,4 @@ +# PYTHON_ARGCOMPLETE_OK """ Copyright 2018 Oliver Smith diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 7e147bc46ce79292133f71569f413731e3b57441..62be77acac13508a1f870f0fddfe5086f8cc2a06 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -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) diff --git a/pmbootstrap.py b/pmbootstrap.py index 54649331cd3681490d681835526e60bb13a3f632..528af6f266a18179ffbefb6aaa0d6b529b9434ae 100755 --- a/pmbootstrap.py +++ b/pmbootstrap.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# PYTHON_ARGCOMPLETE_OK """ Copyright 2018 Oliver Smith diff --git a/setup.py b/setup.py index 7a522333b1ec53bc7fb70a5cd9e65c8be08b56d9..0dba1446d4625c4f63627638d83344eb8918bbb6 100644 --- a/setup.py +++ b/setup.py @@ -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',