diff options
| author | Jeff Carr <[email protected]> | 2025-10-24 11:28:43 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-24 11:28:43 -0500 |
| commit | 88d0ce908c76d98a29ab5ffc3417248f951493fb (patch) | |
| tree | b50a0917f1a1d713fdb5addc6e65dd2842b98fe9 /argv.Print.go | |
| parent | 2b46985ae8def4ff5779fbc027a6ddbe7a1a6a8d (diff) | |
removing log from herev0.0.44
Diffstat (limited to 'argv.Print.go')
| -rw-r--r-- | argv.Print.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/argv.Print.go b/argv.Print.go index 9429a01..7cfbcff 100644 --- a/argv.Print.go +++ b/argv.Print.go @@ -5,6 +5,7 @@ package argvpb import ( "fmt" + "os" "strings" "go.wit.com/lib/cobol" @@ -47,3 +48,26 @@ func (all *Argvs) PrintHistory() { pb.PrintDebugNew("HIST") } } + +func (pb *Argv) PrintStderr() { + if !me.debug { + os.Exit(0) + } + lines := strings.Split(strings.TrimSpace(pb.Stderr), "\n") + if len(lines) == 0 { + os.Exit(0) + } + fmt.Fprintf(os.Stderr, "\n") + for _, line := range lines { + line = strings.TrimSpace(line) + if line == "" { + continue + } + fmt.Fprintf(os.Stderr, "%s\n", line) + } +} + +func (pb *Argv) PrintStderrExit() { + pb.PrintStderr() + os.Exit(0) +} |
