diff --git a/src/atomic-xr/_debug.nu b/src/atomic-xr/_debug.nu index 90575b5..0f165f8 100644 --- a/src/atomic-xr/_debug.nu +++ b/src/atomic-xr/_debug.nu @@ -9,16 +9,8 @@ export def main [ --full (-f) # Include extra debug information ] { let output = $output | default (mktemp -t --suffix .msgpackz) | path expand - log info "This function produces a brotli-compressed msgpack debug file." - if $base64 { - log info $"If you'd like to check what information it contains, use `nu -c '{base64} | decode base64 | from msgpackz'`" - } else { - log info $"If you'd like to check what information it contains, use `nu -c 'open ($output) | from msgpackz'`" - } - - log info "" - log info "Creating debug file..." + log info "Gathering debug information" let flatpak_installed = flatpak list --columns application | lines let sys = if $full { @@ -97,9 +89,31 @@ export def main [ } | to msgpackz | if $base64 { - encode base64 + print (ansi cyan) + $in | encode base64 | print + print (ansi reset) } else { save -f $output log info $"Successfully created debug file. It has been saved to ($output)" } + + if $base64 { + log info $"If you'd like to check what info that contains, use `axr '_debug decode --base64 {base64}'`" + } else { + log info $"If you'd like to check what info it contains, use `axr _debug decode ($output)`" + } +} + +export def decode [ + input # Base64 or file to decode + --base64 + --explore (-e) # Explore output +] { + if $base64 { + $input | decode base64 + } else { + open $input + } + | from msgpackz + | if $explore {explore} else {$in} }