cli

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cli implements the command-line interface for envprof.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec added in v0.0.6

func Exec(options *Options) *cobra.Command

Exec returns the cobra command for executing a command with the active environment.

func Execute

func Execute(version string) error

Execute runs the root command for the envprof CLI application.

func Export

func Export(options *Options) *cobra.Command

Export defines the command for exporting a profile's variables.

func List

func List(options *Options) *cobra.Command

List returns the cobra command for listing profiles and their variables.

func Profiles added in v0.0.8

func Profiles(options *Options) *cobra.Command

Profiles returns the cobra command for listing profiles.

func Shell added in v0.0.1

func Shell(options *Options) *cobra.Command

Shell returns the cobra command for entering a scoped shell with the active environment.

func UnknownSubcommandAction added in v0.0.8

func UnknownSubcommandAction(cmd *cobra.Command, args []string) error

UnknownSubcommandAction handles unknown cobra subcommands. Implements cobra.Command.RunE to provide helpful error messages and suggestions when an unknown subcommand is used. Required when TraverseChildren is true, as this disables cobra's built-in suggestion system. See: - https://github.com/spf13/cobra/issues/981 - https://github.com/containerd/nerdctl/blob/242e6fc6e861b61b878bd7df8bf25e95674c036d/cmd/nerdctl/main.go#L401-L418

func Write added in v0.0.6

func Write(options *Options) *cobra.Command

Write defines the command for writing profile variables to one or multiple dotenv files.

TODO(Idelchi): Refactor this function to reduce cognitive complexity.

Types

type Options added in v0.0.8

type Options struct {
	// EnvProf is the list of candidate profile files to load.
	EnvProf []string
	// Profile is the selected profile.
	Profile string
	// Verbose enables verbose output.
	Verbose bool
}

Options represent the root level configuration.

Jump to

Keyboard shortcuts

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