summaryrefslogtreecommitdiff
path: root/argv.Print.go
diff options
context:
space:
mode:
Diffstat (limited to 'argv.Print.go')
-rw-r--r--argv.Print.go25
1 files changed, 13 insertions, 12 deletions
diff --git a/argv.Print.go b/argv.Print.go
index 368cf7b..bb1de4a 100644
--- a/argv.Print.go
+++ b/argv.Print.go
@@ -23,20 +23,17 @@ func Debugf(fmts string, parts ...any) {
}
// print out auto complete debugging info
-func (pb *Argv) PrintDebug() {
- pb.PrintDebugNew("ARGV")
+func (pb *Argv) PrintDebug(last string) {
+ pb.PrintDebugNew("ARGV", last)
}
-func (pb *Argv) PrintDebugNew(msg string) {
+func (pb *Argv) PrintDebugNew(msg string, last string) {
cmd := fmt.Sprintf("cmd='%s'", pb.GetCmd())
var arglast string
- if me.last == nil {
- arglast = fmt.Sprintf("last='%s'", "<nil>")
- } else {
- arglast = fmt.Sprintf("last='%s'", me.last.GetCmd())
- }
+ arglast = fmt.Sprintf("last='%s'", last)
partial := fmt.Sprintf("p='%s'", pb.Partial)
- dur := cobol.Duration(pb.Ctime)
+ age := cobol.Duration(pb.Ctime)
+ dur := cobol.Duration(pb.Duration)
var fast string
if pb.Fast {
fast = "fast=1," + pb.GetCmd()
@@ -44,12 +41,16 @@ func (pb *Argv) PrintDebugNew(msg string) {
fast = "fast=0," + pb.GetCmd()
}
sargv := fmt.Sprintf("argv(%v)", pb.Real)
- Debugf("%s: age=(%s) %-12.12s %-12.12s %-12.12s %s %s goargs='%v' len(%d)", msg, dur, cmd, arglast, partial, fast, sargv, pb.Goargs, me.all.Len())
+ top := fmt.Sprintf("age=(%s)dur(%s)%-4.4s %-12.12s %-12.12s", age, dur, pb.Uuid, cmd, arglast)
+ Debugf("%s: %s %-12.12s %s %s goargs='%v' len(%d)", msg, top, partial, fast, sargv, pb.Goargs, me.all.Len())
}
-func (all *Argvs) PrintHistory() {
+func (all *Argvs) PrintHistory(last string) {
+ counter := 0
for pb := range all.IterAll() {
- pb.PrintDebugNew("HIST")
+ counter += 1
+ hist := fmt.Sprintf("HIST(%d)", counter)
+ pb.PrintDebugNew(hist, last)
}
}