lib.App: Log reason for skipped completion

The shell completion setup in __run() catches every exception and
silently ignores it. If argcomplete is missing or its initialization
fails, the completion is simply not available and there is no trace
of why, even when logging is turned up to debug level.

Log the reason at debug level: one message when the argcomplete
import fails and one with the exception for any other failure.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-08-15 00:01:20 +02:00
commit 32d46df18d
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -284,8 +284,10 @@ class App: # export
argcomplete.autocomplete(self.__parser, default_completer = NoopCompleter())
except Exception:
pass
except ImportError:
log(DEBUG, 'argcomplete is not installed, shell completion disabled')
except Exception as e:
log(DEBUG, f'Shell completion disabled: {e}')
self.__args = self.__parser.parse_args(args = argv)