aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-12-17 00:19:28 -0500
committerMike Frysinger <vapier@gentoo.org>2021-12-17 00:19:28 -0500
commit1f79c681bbaab91133ee9343690ee563099d0bf0 (patch)
treeb89238cb18fdb4964f8bb62a835adc1b63827416 /lddtree.py
parentseccomp: mark arrays const+static (diff)
downloadpax-utils-1f79c681bbaab91133ee9343690ee563099d0bf0.tar.gz
pax-utils-1f79c681bbaab91133ee9343690ee563099d0bf0.tar.bz2
pax-utils-1f79c681bbaab91133ee9343690ee563099d0bf0.zip
lddtree: add argcomplete support if available
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lddtree.py')
-rwxr-xr-xlddtree.py8
1 files changed, 8 insertions, 0 deletions
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 <vapier@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