command

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandHelp

func CommandHelp(c Command) string

CommandHelp retourne l’aide sur une commande

func CommandSetHelp

func CommandSetHelp(cs CommandSet) string

CommandSetHelp retourne l’aide sur un ensemble de commandes

Types

type Command

type Command interface {
	Parser
	Helper
	Help() string
	Flags() FlagSet
	Run()
}

Command représente une commande à saisir

type CommandSet

type CommandSet interface {
	Parser
	Helper
	Help() string
	Commands() []Command
}

CommandSet est une commande regroupant plusieurs sous-commandes

type Flag

type Flag interface {
	Parser
	Helper
	ArgName() string
	Flags() []string
	Value() any
}

Flag est une interface réprsentant des arguments nommés d’une ligne de commande

type FlagSet

type FlagSet interface {
	Parser
	Help() string
	HelpRequired() bool
	Flags() []Flag
	Args() []string
}

FlagSet est un ensemble de flags

type Helper

type Helper interface {
	Name() string
	Usage() string
}

Helper est une interface permettant d’afficher l’aide d’une ligne de commande

type Parser

type Parser interface {
	Parse([]string) ([]string, error)
	IsParsed() bool
	Reset()
}

Parser est une interface pour parser des arguments en ligne de commande

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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