Equationzhao/g

[BUG] panic when set --title and one of --table/csv/tsv/html

Equationzhao opened this issue · 0 comments

Describe the bug

Version: v0.25.3
Please file an issue at Github Repo with the following panic info

 × error message:
strings: negative Repeat count
 
 × stack trace:
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/homebrew/opt/go/libexec/src/runtime/debug/stack.go:24 +0x64
main.main.func1()
        /Users/equationzhao/g/main.go:25 +0x200
panic({0x100767800?, 0x100860c00?})
        /opt/homebrew/opt/go/libexec/src/runtime/panic.go:914 +0x218
strings.Repeat({0x100705230?, 0x10060181c?}, 0x10060181c?)
        /opt/homebrew/opt/go/libexec/src/strings/strings.go:554 +0x2e0
github.com/Equationzhao/g/internal/cli.glob..func34.3.glob..func34.3.1.func2({0x10086b7e8?, 0x140001fb540}, {0x14000134000?, 0x100194d78?, 0x10?})
        /Users/equationzhao/g/internal/cli/g.go:989 +0x328
github.com/Equationzhao/g/internal/display.fire(...)
        /Users/equationzhao/g/internal/display/printer.go:55
github.com/Equationzhao/g/internal/display.(*TablePrinter).PrintBase(0x140001fb540, 0x1400059b420, {0x14000134000, 0x15, 0x20})
        /Users/equationzhao/g/internal/display/printer.go:544 +0x214
github.com/Equationzhao/g/internal/display.(*TSVPrinter).Print(0x100d895b0?, {0x14000134000?, 0x10060181c?, 0x4?})
        /Users/equationzhao/g/internal/display/printer.go:658 +0x60
github.com/Equationzhao/g/internal/cli.glob..func34(0x14000356480)
        /Users/equationzhao/g/internal/cli/g.go:1036 +0x2d2c
github.com/urfave/cli/v2.(*Command).Run(0x1400025c420, 0x14000356480, {0x14000338000, 0x7, 0x7})
        /Users/equationzhao/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/command.go:279 +0x754
github.com/urfave/cli/v2.(*App).RunContext(0x1400031e200, {0x100867d90?, 0x100d88d40}, {0x14000338000, 0x7, 0x7})
        /Users/equationzhao/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/app.go:337 +0x534
github.com/urfave/cli/v2.(*App).Run(0x10086b580?, {0x14000338000?, 0x3?, 0x3?})
        /Users/equationzhao/go/pkg/mod/github.com/urfave/cli/v2@v2.27.1/app.go:311 +0x3c
main.main()
        /Users/equationzhao/g/main.go:68 +0x29c

To Reproduce
g --table/csv/tsv/html --title

Info (please complete the following information):

  • OS: [macOS 14.0]
  • Version [v0.25.2]