Skip to content

Commit f61cc85

Browse files
committed
tpmi-spec-files-generator: minor improvement
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
1 parent dfffdec commit f61cc85

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tpmi-spec-files-generator

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ def _build_arguments_parser() -> ArgParse.ArgsParser:
6969

7070
text = "Path to the input directory with TPMI XML files."
7171
arg = parser.add_argument("-i", "--input-dir", type=Path, help=text)
72-
setattr(arg, "completer", getattr(argcomplete.completers, "DirectoriesCompleter"))
72+
if _ARGCOMPLETE_AVAILABLE:
73+
setattr(arg, "completer", getattr(argcomplete.completers, "DirectoriesCompleter"))
7374

7475
text = "Path to the output directory for the generated pepc TPMI spec files."
7576
arg = parser.add_argument("-o", "--output-dir", type=Path, help=text)
76-
setattr(arg, "completer", getattr(argcomplete.completers, "DirectoriesCompleter"))
77+
if _ARGCOMPLETE_AVAILABLE:
78+
setattr(arg, "completer", getattr(argcomplete.completers, "DirectoriesCompleter"))
7779

7880
text = "Comma-separated list of TPMI features to include (all features by default)."
7981
parser.add_argument("--include-features", type=str, help=text, default="")

0 commit comments

Comments
 (0)