tool/os

CUE v0.18.0

Package os defines tasks for retrieving os-related information.

CUE definitions:

Schemas

Clearenv

cue
Clearenv: {
	$id: _id
	_id: "tool/os.Clearenv"
}

Clearenv clears all environment variables.

Environ

cue
Environ: {
	$id: _id
	_id: "tool/os.Environ"

	// A map of all populated values.
	// Individual entries may be specified ahead of time to enable
	// validation and parsing. Values that are marked as required
	// will fail the task if they are not found.
	{[Name]: Value}
}

Environ populates a struct with all environment variables.

Getenv

cue
Getenv: {
	$id: _id
	_id: "tool/os.Getenv"

	{[Name]: Value}
}

Getenv gets and parses the specific command line variables.

Name

cue
Name: !="" & !~"^[$]"

Name indicates a valid flag name.

Setenv

cue
Setenv: {
	$id: _id
	_id: "tool/os.Setenv"

	{[Name]: Value}
}

Setenv defines a set of command line flags, the values of which will be set at run time. The doc comment of the flag is presented to the user in help.

To define a shorthand, define the shorthand as a new flag referring to the flag of which it is a shorthand.

Value

cue
Value: bool | number | *string | null

A Value are all possible values allowed in flags. A null value unsets an environment variable.

Install CUE