Help us shape the future of Go! Take the 2026 Go Developer Survey

command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package command analyse les arguments d'une commande docker ou docker compose.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Family       Family
	Subcommand   string            // run, build, pull, up, « network rm »…
	Flags        map[string]string // nom sans tirets → valeur (vide pour un booléen), masquée si sensible
	Positionals  []string          // arguments hors options (image, conteneur, commande…)
	ComposeFiles []string          // fichiers passés par -f/--file à docker compose
	Interactive  bool              // la commande utilise le terminal (stderr non capturé)
}

Command est la commande analysée, dérivée des arguments capturés (sans « docker »).

func Parse

func Parse(args []string) Command

Parse analyse les arguments d'une commande docker (sans le mot « docker »). Les valeurs sensibles sont masquées dès l'analyse.

func (Command) Image

func (c Command) Image() string

Image renvoie l'image visée par la commande, si la sous-commande en désigne une.

type Family

type Family string

Family distingue les commandes docker des commandes docker compose.

const (
	FamilyDocker  Family = "docker"
	FamilyCompose Family = "compose"
)

Jump to

Keyboard shortcuts

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