summaryrefslogtreecommitdiff
path: root/auto.Print.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-16 13:58:28 -0500
committerJeff Carr <[email protected]>2025-10-17 01:45:59 -0500
commit411226cf9df0814ff8e714958da87c853b519bc6 (patch)
treeeea63f72a2614a0cec3c844edbf7cf162e4257e2 /auto.Print.go
parent28839452b290b83d409193044c5737a92cc1ec3e (diff)
A new life awaits you in the Off-world colonies!v0.0.39
Diffstat (limited to 'auto.Print.go')
-rw-r--r--auto.Print.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/auto.Print.go b/auto.Print.go
deleted file mode 100644
index 377d921..0000000
--- a/auto.Print.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package prep
-
-// debug argv protobuf functions
-// enable with --autodebug or Setenv( "AUTOCOMPLETE_VERBOSE" )
-
-import (
- "fmt"
- "os"
- "strings"
-
- "go.wit.com/lib/cobol"
-)
-
-// decides here to print to STDERR or not
-func (pb *Auto) Debugf(fmts string, parts ...any) {
- fmts = strings.TrimSpace(fmts)
- fmts += "\n"
- // NOTE: env doesn't work probably most (all?) the time because bash
- // doesn't send all the ENV to autocomplete. so, trap on a "--autodebug" command line arg
- if os.Getenv("AUTOCOMPLETE_VERBOSE") == "true" || pb.Debug {
- if !pb.Newline {
- fmt.Fprintf(os.Stderr, "\n")
- pb.Newline = true
- }
- fmt.Fprintf(os.Stderr, fmts, parts...)
- } else {
- // fmt.Fprintf(os.Stderr, "NOT DOING ANYTHING\n")
- }
-}
-
-// print out auto complete debugging info
-func (pb *Auto) PrintDebug() {
- pb.PrintDebugNew("ARGV")
-}
-
-func (pb *Auto) PrintDebugNew(msg string) {
- cmd := fmt.Sprintf("cmd='%s'", pb.Cmd)
- arglast := fmt.Sprintf("last='%s'", pb.Last)
- partial := fmt.Sprintf("p='%s'", pb.Partial)
- dur := cobol.Duration(pb.Ctime)
- var fast string
- if pb.Fast {
- fast = "fast=1," + pb.Fastcmd
- } else {
- fast = "fast=0," + pb.Fastcmd
- }
- sargv := fmt.Sprintf("argv(%v)", pb.Argv)
- pb.Debugf("%s: age=(%s) %-12.12s %-12.12s %-12.12s %s %s goargs='%v'", msg, dur, cmd, arglast, partial, fast, sargv, pb.Goargs)
-}
-
-func (all *Autos) PrintHistory() {
- for pb := range all.IterAll() {
- pb.PrintDebugNew("HIST")
- }
-}
-
-// todo: fix this
-func (pb *Auto) WriteHelp() {
- me.pp.WriteHelp(os.Stdout)
-}