command

package
v0.0.0-...-ea96815 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgumentsToEnv

func ArgumentsToEnv(cmd *command.Command, dst *[]string, prefix string)

ToEnv writes shell variables to dst.

func Env

func Env(cmd *command.Command, seed []string) []string

func EnvironmentMap

func EnvironmentMap(cmd *command.Command) map[string]string

func MilpaComplete

func MilpaComplete(cmd *command.Command, currentValue string, config string) (values []string, flag cobra.ShellCompDirective, err error)

func New

func New(path string, repo string) (cmd *command.Command, err error)

func OptionsEnvMap

func OptionsEnvMap(cmd *command.Command, dst *map[string]string)

func OptionsToEnv

func OptionsToEnv(cmd *command.Command, dst *[]string, prefix string)

ToEnv writes shell variables to dst.

func ToEval

func ToEval(cmd *command.Command, args []string) string

Types

type Kind

type Kind string
const (
	KindUnknown    Kind = ""
	KindExecutable Kind = "executable"
	KindSource     Kind = "source"
	KindVirtual    Kind = "virtual"
	KindRoot       Kind = "root"
)

type Meta

type Meta struct {
	// Path is the filesystem path to this command
	Path string `json:"path" yaml:"path"`
	// Repo is the filesystem path to this repo, including /.milpa
	Repo string `json:"repo" yaml:"repo"`
	// Name is a list of words naming this command
	Name []string `json:"name" yaml:"name"`
	// Kind can be executable (a binary or executable file), source (.sh file), or virtual (a sub-command group)
	Kind Kind `json:"kind" yaml:"kind"`
	// contains filtered or unexported fields
}

func (*Meta) ParsingErrors

func (meta *Meta) ParsingErrors() []error

Jump to

Keyboard shortcuts

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