From 6ec06064c06a040b7673c58193a979988ed11520 Mon Sep 17 00:00:00 2001 From: AlejandroSuero Date: Sun, 2 Jun 2024 18:13:49 +0200 Subject: [PATCH] feat(#100): implemented `show-cmd` flag --- pty.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pty.go b/pty.go index 7c782b8..f0dd10a 100644 --- a/pty.go +++ b/pty.go @@ -6,6 +6,7 @@ package main import ( "bytes" "context" + "fmt" "io" "os" "os/exec" @@ -49,5 +50,8 @@ func executeCommand(config Config) (string, error) { if err != nil { return "", err } + if config.ShowCmd { + return fmt.Sprintf("%s\n\n%s", config.Execute, out.String()), nil + } return out.String(), nil }