feat: add list command with global filters

This commit is contained in:
Rogee
2025-10-29 16:08:46 +08:00
parent 88563d48e2
commit fa57af8a26
29 changed files with 1892 additions and 25 deletions

View File

@@ -0,0 +1,21 @@
package output
import "fmt"
// Format identifiers mirrored from listing package to avoid import cycle.
const (
FormatTable = "table"
FormatPlain = "plain"
)
// NewFormatter selects the appropriate renderer based on format key.
func NewFormatter(format string) (Formatter, error) {
switch format {
case FormatPlain:
return NewPlainFormatter(), nil
case FormatTable, "":
return NewTableFormatter(), nil
default:
return nil, fmt.Errorf("unsupported format %q", format)
}
}