You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
Add a log line like this log.Debug().Str("scanpath", h.ScanPath).Send() at the top of hunter.Hunt() and run a few pillager hunt commands observing the logs.
go run cmd/pillager/main.go hunt . -l debug
5:36AM DBG scanpath=.
go run cmd/pillager/main.go hunt ./_examples/testdata -l debug
5:38AM DBG scanpath=.
Expected behavior
Scanpath should be set to the value of the command line argument.
The text was updated successfully, but these errors were encountered:
Woops! Missed that one. I'll take a peek at this. I think I need to add some basic smoke tests to catch goofy errors like this to prevent any unexpected behaviors with the cli commands and flags.
Yeah, I played around with some unit tests but couldn't settle on a pattern that made sense. Testing cli behavior is hard, I went deep down a rabbit hole reading how other people test clis. Probably some basic "run with this set of commands and flags and snapshot the output" type of tests would work
Describe the bug
The
hunter.WithScanPath
function doesn't pass it's argument down to validate, rather it passes in the existingConfig.ScanPath
.Here's the offending line
pillager/pkg/hunter/config.go
Line 80 in 4b1df72
To Reproduce
Add a log line like this
log.Debug().Str("scanpath", h.ScanPath).Send()
at the top ofhunter.Hunt()
and run a fewpillager hunt
commands observing the logs.Expected behavior
Scanpath should be set to the value of the command line argument.
The text was updated successfully, but these errors were encountered: