clishared

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package clishared holds helpers shared across krit's verb-specific CLI packages (internal/cli/<verb>/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigInDir added in v0.2.0

func FindConfigInDir(dir string) string

FindConfigInDir probes dir for the first present file in config.Filenames and returns its path, or "" when none is present (or dir is empty).

func ParseRuleNameSetCSV added in v0.2.0

func ParseRuleNameSetCSV(csv string) map[string]bool

ParseRuleNameSetCSV parses a comma-separated list of rule names into a lookup set. Whitespace around each name is trimmed. Empty input returns an empty (non-nil) map so callers can index it without nil checks.

Shared by --disable-rules / --enable-rules on both the CLI and daemon paths. A trailing comma or whitespace-only token produces an empty-string entry — harmless because no real rule has ID "".

func ScanModuleKotlinFiles

func ScanModuleKotlinFiles(mod *module.Module) []*scanner.File

ScanModuleKotlinFiles finds and parses all .kt files under the module's source roots.

func SimpleName

func SimpleName(fqn string) string

SimpleName extracts the last dot-separated segment of an FQN, stripping any trailing parenthesised arity/signature.

func SplitPositional

func SplitPositional(args []string, maxVal int) (positional, rest []string)

SplitPositional pulls up to max leading non-flag arguments out of args and returns them alongside the remaining (flag) arguments. Once a flag appears, all subsequent arguments are treated as flag args.

Types

type MultiString added in v0.2.0

type MultiString []string

MultiString is a flag.Value that accumulates repeated --flag value invocations into a slice.

func (*MultiString) Set added in v0.2.0

func (m *MultiString) Set(value string) error

func (*MultiString) String added in v0.2.0

func (m *MultiString) String() string

Jump to

Keyboard shortcuts

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