cli

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli implements the graphnest command-line tool.

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version is set at build time with -ldflags "-X github.com/balcsida/graphnest/internal/cli.Version=<v>".

Functions

func Run

func Run(ctx context.Context, args []string, env Environment, stdout, stderr io.Writer) int

Run executes one graphnest command and returns the process exit code.

Types

type Environment

type Environment struct {
	Getenv   func(string) string
	ReadFile func(string) ([]byte, error)
	Git      func(ctx context.Context, dir string, args ...string) ([]byte, error) // runs the git binary; replaceable in tests
	Now      func() time.Time
	// Sleep waits between upload attempts; it returns early with the context's error.
	Sleep func(context.Context, time.Duration) error
	// Repository reads commits and evaluates ignore rules for freshness verification.
	Repository graphimport.Git
	// ConfigDir returns the user configuration directory that holds stored logins; nil means there is none.
	ConfigDir func() (string, error)
	// OpenBrowser opens a URL in the system browser; nil leaves the printed URL to the user.
	OpenBrowser func(url string) error
}

Environment holds everything Run reads from outside the process.

func OSEnvironment

func OSEnvironment() Environment

OSEnvironment is the real process environment.

Jump to

Keyboard shortcuts

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