lib.App: Refactor App / Cmd to adress multiple functionality and style issues #60
1 changed files with 4 additions and 2 deletions
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>
commit
32d46df18d
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue