commit: 1f79c681bbaab91133ee9343690ee563099d0bf0 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Fri Dec 17 05:19:28 2021 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Fri Dec 17 05:19:28 2021 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=1f79c681
lddtree: add argcomplete support if available Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> lddtree.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lddtree.py b/lddtree.py index dd17387..ef8a9b2 100755 --- a/lddtree.py +++ b/lddtree.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# PYTHON_ARGCOMPLETE_OK # Copyright 2012-2014 Gentoo Foundation # Copyright 2012-2014 Mike Frysinger <vap...@gentoo.org> # Copyright 2012-2014 The Chromium OS Authors @@ -50,6 +51,11 @@ import sys assert sys.version_info >= (3, 6), f'Python 3.6+ required, but found {sys.version}' +try: + import argcomplete +except ImportError: + argcomplete = None + from elftools.elf.elffile import ELFFile from elftools.common import exceptions @@ -739,6 +745,8 @@ def GetParser(): action='store_true', default=False, help='Copy over plain (non-ELF) files instead of warn+ignore') + if argcomplete is not None: + argcomplete.autocomplete(parser) return parser