Documentation
¶
Index ¶
- Constants
- func AddFlags(flags *pflag.FlagSet)
- func Project(raw any, columns []Column) ([]string, [][]string, error)
- func Render(out io.Writer, headers []string, rows [][]string, availableWidth int) error
- func RenderAutoWidth(out io.Writer, headers []string, rows [][]string) error
- func RenderAutoWidthWithOptions(out io.Writer, headers []string, rows [][]string, options RenderOptions) error
- func RenderWithOptions(out io.Writer, headers []string, rows [][]string, availableWidth int, ...) error
- func ValidateColumnFlags(helper cmdpkg.Helper, cfg config.Hook) error
- type Column
- type RenderOptions
Constants ¶
const ( FlagName = "columns" MaxColumnWidth = 40 )
Variables ¶
This section is empty.
Functions ¶
func RenderAutoWidth ¶
RenderAutoWidth detects the output terminal width and falls back to 120 columns when the output does not expose a terminal file descriptor.
func RenderAutoWidthWithOptions ¶ added in v1.10.0
func RenderWithOptions ¶ added in v1.10.0
Types ¶
type Column ¶
Column is a user-selected text column and its compiled field path.
type RenderOptions ¶ added in v1.10.0
type RenderOptions struct {
// MinimumWidths prevents selected columns from shrinking below the
// corresponding display width. Missing entries use the legacy minimum.
MinimumWidths []int
// NoTrunc preserves natural cell widths regardless of terminal width.
NoTrunc bool
}
RenderOptions configures static table width allocation.