File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 2121 plugins ,
2222)
2323
24+ try :
25+ import argcomplete
26+
27+ HAS_ARGCOMPLETE = True
28+ except ImportError :
29+ HAS_ARGCOMPLETE = False
30+
31+
2432# Make sure we log everything
2533
2634rootlog = logging .getLogger ()
@@ -276,6 +284,10 @@ def run(self):
276284 # Hand the plugin requirements over to the CLI (us) and let it construct the config tree
277285
278286 # Run the argparser
287+ if HAS_ARGCOMPLETE :
288+ # The autocompletion line must be after the partial_arg handling, so that it doesn't trip it
289+ # before all the plugins have been added
290+ argcomplete .autocomplete (parser )
279291 args = parser .parse_args ()
280292
281293 vollog .log (
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2+ # PYTHON_ARGCOMPLETE_OK
23
34# This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0
45# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
You can’t perform that action at this time.
0 commit comments