From a73acedc6dc4996f8b2debccc4fcb1d5c70b0d75 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 3 Jun 2022 23:12:53 -0400 Subject: [PATCH] Minor tracing tweaks --- argh/parser_config.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/argh/parser_config.go b/argh/parser_config.go index e77638e..78d7277 100644 --- a/argh/parser_config.go +++ b/argh/parser_config.go @@ -16,6 +16,8 @@ var ( type NValue int func (nv NValue) Contains(i int) bool { + tracef("NValue.Contains(%v)", i) + if i < int(ZeroValue) { return false } @@ -41,6 +43,8 @@ type CommandConfig struct { } func (cCfg *CommandConfig) GetCommandConfig(name string) (CommandConfig, bool) { + tracef("CommandConfig.GetCommandConfig(%q)", name) + if cCfg.Commands == nil { cCfg.Commands = &Commands{Map: map[string]CommandConfig{}} } @@ -49,6 +53,8 @@ func (cCfg *CommandConfig) GetCommandConfig(name string) (CommandConfig, bool) { } func (cCfg *CommandConfig) GetFlagConfig(name string) (FlagConfig, bool) { + tracef("CommandConfig.GetFlagConfig(%q)", name) + if cCfg.Flags == nil { cCfg.Flags = &Flags{Map: map[string]FlagConfig{}} } @@ -68,6 +74,8 @@ type Flags struct { } func (fl *Flags) Get(name string) (FlagConfig, bool) { + tracef("Flags.Get(%q)", name) + if fl.Map == nil { fl.Map = map[string]FlagConfig{} } @@ -86,7 +94,7 @@ type Commands struct { } func (cmd *Commands) Get(name string) (CommandConfig, bool) { - tracef("Get(%q)", name) + tracef("Commands.Get(%q)", name) if cmd.Map == nil { cmd.Map = map[string]CommandConfig{}