globalflagcov

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package globalflagcov computes which persistent global CLI flags (commands.Flags) are referenced transitively from each cobra command's RunE handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlagSet

type FlagSet struct {
	JSON    bool
	DryRun  bool
	Yes     bool
	Force   bool
	Verbose bool
}

FlagSet records whether each global persistent flag is read on some path from the handler.

type Row

type Row struct {
	// Path is space-separated from the second segment (e.g. "workflow status"), excluding "da".
	Path string
	// Handler is the runtime symbol for the RunE func (or closure).
	Handler string
	// Flags is transitive coverage through same-package calls.
	Flags FlagSet
	// Notes is non-empty when analysis was partial (e.g. unresolved closure).
	Notes string
}

Row is one CLI command path and observed global-flag coverage.

func Report

func Report(moduleRoot string) ([]Row, error)

Report generates coverage rows for every command with a RunE (or Run) on the default root tree.

Jump to

Keyboard shortcuts

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