base

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package base defines shared basic pieces of the Lava command, in particular logging and the Command structure.

Index

Constants

This section is empty.

Variables

View Source
var Commands []*Command

Commands is initialized with all the Lava commands.

View Source
var LogLevel = &slog.LevelVar{}

LogLevel is the level of the default logger.

Functions

This section is empty.

Types

type Command

type Command struct {
	Run       func(args []string) error
	UsageLine string
	Short     string
	Long      string
	Flag      flag.FlagSet
}

Command represents a Lava command.

func (*Command) Name

func (c *Command) Name() string

Name returns the name of the command, which is the text before the first white space character in the UsageLine field.

func (*Command) Usage

func (c *Command) Usage()

Usage prints a usage message documenting the command.

Jump to

Keyboard shortcuts

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