Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 8c25906

Browse files
committed
Log non-default command line arguments
1 parent bc3adb4 commit 8c25906

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ func main() {
7676
flag.Parse()
7777
log.SetFlags(0)
7878

79+
flag.Visit(func(f *flag.Flag) {
80+
fmt.Printf("Command line flag %s: %q (default %q)\n", f.Name, f.Value.String(), f.DefValue)
81+
})
82+
7983
// Start pprof server, if desired.
8084
if *pprof != "" {
8185
go func() {

0 commit comments

Comments
 (0)