From 1df1dbd552ef4686e1c85afc1a74f1611bb603ec Mon Sep 17 00:00:00 2001 From: Jack Wright Date: Sun, 8 Dec 2024 20:34:38 -0800 Subject: [PATCH] cobra logging command --- nushell_completions.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nushell_completions.go b/nushell_completions.go index 8523652..7a8962d 100644 --- a/nushell_completions.go +++ b/nushell_completions.go @@ -36,6 +36,15 @@ let cobra_completer = {|spans| let cmd = $spans | first let rest = $spans | skip + def cobra_log [message] { + let file = do -i {$env | get NUSHELL_COMP_DEBUG_FILE} + if $file != null { + echo $"($message)\n" | save $file --append + } + } + + cobra_log $"External Completer called for cmd ($cmd)" + def exec_complete [ spans: list ] {