where

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package where provides the "where" command, which prints the absolute path of the discovered .np/ directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(f *cmdutil.Factory) *cli.Command

NewCmd constructs the "where" command which prints the path of the .np/ directory discovered by walking up from the current working directory. Useful for scripting and debugging.

func Run

func Run(_ context.Context, input RunInput) error

Run executes the where workflow: discovers the .np/ directory and prints its path.

Types

type RunInput

type RunInput struct {
	// DiscoverFunc locates the database file, returning its absolute path.
	// In production this is Factory.DatabasePath (workspace-aware); tests
	// provide a stub.
	DiscoverFunc func() (string, error)

	// JSON enables machine-readable JSON output.
	JSON bool

	// WriteTo receives the output.
	WriteTo io.Writer
}

RunInput holds the parameters for the where command's core logic, decoupled from CLI flag parsing so it can be tested directly. The DiscoverFunc allows tests to inject a stub instead of hitting the real filesystem.

Jump to

Keyboard shortcuts

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