cmd

package
v1.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: BSD-3-Clause Imports: 31 Imported by: ? 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

Index

Constants

View Source
const (
	// Generic error code
	ExitCodeError = 1
	// Returned when jobs were submitted to a scheduler (overlays will be created asynchronously)
	ExitCodeJobsSubmitted = 3
)

Exit codes used by various commands

Variables

This section is empty.

Functions

func Execute

func Execute()

func ExitIfJobsSubmitted added in v1.1.1

func ExitIfJobsSubmitted(graph *build.BuildGraph)

ExitIfJobsSubmitted exits the process with ExitCodeJobsSubmitted if a scheduler submission was requested and the graph shows job IDs were created.

func ExitWithError added in v1.1.1

func ExitWithError(format string, a ...interface{})

ExitWithError prints an error and exits with ExitCodeError

func KnownFlags added in v1.1.1

func KnownFlags() map[string]bool

KnownFlags returns a map of all known condatainer flags

func ParseCommandArgs added in v1.1.1

func ParseCommandArgs(subcommand string) ([]string, []string)

ParseCommandArgs parses arguments from os.Args after a given subcommand Returns: commands (positional args), apptainerFlags (unknown flags for apptainer)

func ParseInstanceArgs added in v1.1.1

func ParseInstanceArgs(subcommand string) (string, []string)

ParseInstanceArgs parses arguments for instance start/run commands Returns: instanceName, apptainerFlags

func PrepareCommandAndHidePrompt added in v1.1.1

func PrepareCommandAndHidePrompt(commands []string) ([]string, bool)

PrepareCommandAndHidePrompt prepares the command array and determines if prompt should be hidden If commands is empty, defaults to ["bash"] with hidePrompt=false If commands has 1 element, returns hidePrompt=false Otherwise returns hidePrompt=true

func RegisterCommonFlags added in v1.1.1

func RegisterCommonFlags(cmd *cobra.Command, flags *CommonFlags)

RegisterCommonFlags registers common flags on a cobra command

func ResolveBaseImage added in v1.1.1

func ResolveBaseImage(baseImage string) string

ResolveBaseImage resolves a base image path to an absolute path Returns empty string if baseImage is empty

Types

type CommonFlags added in v1.1.1

type CommonFlags struct {
	Overlays    []string
	WritableImg bool
	EnvSettings []string
	BaseImage   string
	BindPaths   []string
	Fakeroot    bool
}

CommonFlags holds the common flags used by exec, instance start, and instance exec

type HelperScriptEntry

type HelperScriptEntry struct {
	Path string `json:"path"`
}

HelperScriptEntry represents a helper script metadata entry

type PackageInfo

type PackageInfo struct {
	Name        string // name/version format
	Path        string // full path to build script
	IsContainer bool   // true if .def file
	IsInstalled bool   // true if overlay exists
	IsRemote    bool   // true if from remote repository
}

PackageInfo holds information about a build script

Jump to

Keyboard shortcuts

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