jq

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagName                    = "jq"
	ColorFlagName               = "jq-color"
	ColorThemeFlagName          = "jq-color-theme"
	RawOutputFlagName           = "jq-raw-output"
	RawOutputFlagShort          = "r"
	DefaultExpressionConfigPath = "jq.default-expression"
	ColorEnabledConfigPath      = "jq.color.enabled"
	ColorThemeConfigPath        = "jq.color.theme"
	RawOutputConfigPath         = "jq.raw-output"
	DefaultTheme                = "friendly"
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *pflag.FlagSet)

func ApplyFilter

func ApplyFilter(body []byte, filter string) ([]byte, error)

func ApplyRawFilter

func ApplyRawFilter(body []byte, filter string, out io.Writer) error

func ApplyToRaw

func ApplyToRaw(raw any, outType cmdcommon.OutputFormat, settings Settings, out io.Writer) (any, bool, error)

func BindFlags

func BindFlags(cfg config.Hook, flags *pflag.FlagSet) error

func BodyToPrintable

func BodyToPrintable(body []byte) string

func HasFilter

func HasFilter(settings Settings) bool

func MaybeColorizeOutput

func MaybeColorizeOutput(raw []byte, formatted, theme string) string

func ShouldUseColor

func ShouldUseColor(mode cmdcommon.ColorMode, out io.Writer) bool

func ValidateOutputFormat

func ValidateOutputFormat(outType cmdcommon.OutputFormat, settings Settings) error

Types

type Settings

type Settings struct {
	Filter    string
	ColorMode cmdcommon.ColorMode
	Theme     string
	RawOutput bool
}

func ResolveSettings

func ResolveSettings(command *cobra.Command, cfg config.Hook) (Settings, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL