args: fix help not usually showing

another weird side effect of the line cache/logging stuff.
The true stderr is now stored in the "stderr" global variable and is
used to print the help screen.
This commit is contained in:
Harvey Tindall
2023-06-11 15:48:27 +01:00
parent e4f03fac4b
commit 456c99d7db
2 changed files with 11 additions and 4 deletions
+2
View File
@@ -14,6 +14,8 @@ import (
var logPath string = filepath.Join(temp, "jfa-go.log")
var lineCache = linecache.NewLineCache(100)
var stderr = os.Stderr
func logOutput() (closeFunc func(), err error) {
old := os.Stdout
writers := []io.Writer{old, colorStripper{lineCache}}