rootcmd

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	setts *Settings,
	rootArgs *Args,
	config any) (rootCmd *cobra.Command, preExecFunc func() error)

Create a new `quitsh` CLI with settings `setts` and root arguments `rootArgs`. The full argument structure `allArgs` is treated as `any` and will be used to parse the configuration files `--config` (`--config-user`) into before startup.

Types

type Args

type Args struct {
	// The config YAML from which we read parameters for the CLI.
	Config string `yaml:"-"`
	// The config YAML (user overlay).
	ConfigUser string `yaml:"-"`

	// Working directory to switch to at startup.
	// This will be used to search for components.
	// This will be used to define the `RootDir` directory.
	Cwd string `yaml:"cwd"`

	// The root directory of quitsh.
	// By default its the Git root directory resolved starting from
	// `Cwd`.
	RootDir string `yaml:"rootDir"`

	// The log level `debug,info,warning,error`.
	LogLevel string `yaml:"logLevel"`

	// Enable environment print on command execution errors.
	EnableEnvPrint bool `yaml:"enableEnvPrint"`

	// Disable any toolchain dispatch which might happen.
	SkipToolchainDispatch bool `yaml:"skipToolchainDispatch"`

	// If we use a global output directory
	// instead of component's specific one.
	GlobalOutput bool `yaml:"globalOutput"`
	// Use a specific output directory.
	GlobalOutputDir string `yaml:"outputDir"`
}

type Settings

type Settings struct {
	Name        string
	Version     *version.Version
	Description string
}

Jump to

Keyboard shortcuts

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