feat: parse all Go CLIs with flaggy; dump bash complete.
stdlib flag dropped --hop after the query. One wrapper in internal/cli, source <(./bin/cli/complete.go bash). Gitea #34.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package cli
|
||||
|
||||
import "github.com/integrii/flaggy"
|
||||
|
||||
type QAStats struct {
|
||||
JSONL string
|
||||
}
|
||||
|
||||
func QAParser() *flaggy.Parser {
|
||||
c := QAStats{}
|
||||
return BindQA(&c)
|
||||
}
|
||||
|
||||
func BindQA(c *QAStats) *flaggy.Parser {
|
||||
p := New("qa-stats")
|
||||
p.Description = "DuckDB quantiles / JSONL count"
|
||||
p.String(&c.JSONL, "", "jsonl", "JSONL file (else stdin JSON [float,…])")
|
||||
return p
|
||||
}
|
||||
|
||||
func ParseQAStats(args []string) (QAStats, error) {
|
||||
var c QAStats
|
||||
return c, Parse(BindQA(&c), args)
|
||||
}
|
||||
Reference in New Issue
Block a user