fscmd

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

Cmd represents a command.

func Cmds

func Cmds() []*Cmd

Cmds returns a slice of all available commands, sorted in increasing order by long name.

func Get

func Get(name string) (*Cmd, bool)

Get returns the command with the given name, if any.

func (*Cmd) Description

func (c *Cmd) Description() string

Description returns a brief one-line description of the command.

func (*Cmd) LongName

func (c *Cmd) LongName() string

LongName returns the long form of the command name. If no long form is set, this will be the same as the short form returned by Name.

func (*Cmd) Name

func (c *Cmd) Name() string

Name returns the short form of the command name.

func (*Cmd) Parse

func (c *Cmd) Parse(pwd string, args []string) (RunFunc, error)

Parse attempts to generate a run function from the given command-line arguments.

func (*Cmd) String

func (c *Cmd) String() string

String returns "[Long name, ]Name\tDescription".

type RunFunc

type RunFunc func(context.Context, fs.Interface) error

RunFunc is a function that can be run on the given storage to execute a command.

Jump to

Keyboard shortcuts

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