From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8CA40158086 for ; Fri, 17 Dec 2021 05:19:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 943E7E0826; Fri, 17 Dec 2021 05:19:30 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7114DE0826 for ; Fri, 17 Dec 2021 05:19:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE116343559 for ; Fri, 17 Dec 2021 05:19:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 59CA814D for ; Fri, 17 Dec 2021 05:19:26 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1639718368.1f79c681bbaab91133ee9343690ee563099d0bf0.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: lddtree.py X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 1f79c681bbaab91133ee9343690ee563099d0bf0 X-VCS-Branch: master Date: Fri, 17 Dec 2021 05:19:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 819fe1e3-631c-4451-b0c1-8da21f222f4b X-Archives-Hash: f5c7e9b0f7f7b7f1cd8685faee81ccb4 commit: 1f79c681bbaab91133ee9343690ee563099d0bf0 Author: Mike Frysinger gentoo org> AuthorDate: Fri Dec 17 05:19:28 2021 +0000 Commit: Mike Frysinger gentoo 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 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 # 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