IsDistrobox matched any label key OR value containing "distrobox", so
unrelated containers carrying a path or project tag that happened to
include the substring (e.g. a workdir under a "distrobox" directory)
leaked into `distrobox list` — and into the rm/upgrade/stop pipelines
that filter through the same call.
Label values are never authoritative; only `manager=distrobox` and the
`distrobox.*` key namespace are ever set by us. Check those directly,
keeping 24b31ed8 working for manager-overridden boxes (apx).
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Rewrite distrobox-*.md to `distrobox <cmd>`, reconcile flag tables with
internal/cli, refresh README+useful_tips, regenerate man/man1/*.1.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Wrappers in completions/ call --generate-shell-completion; a Go
ShellComplete callback emits flag names so urfave's default response
(subcommands only) is replaced with the full candidate set.
This replaces old hard-coded way to auto-complete using shell script's
parsing.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Fix "contaiers" typo (list, rm), route the upgrade error through the
printer, and simplify joinHooks now that tests/compare.sh is gone.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Env vars were read in three layers — cli.EnvVars on flags, os.Getenv
in CLI actions, and the podman provider — leaving library users no
single override point. Funnelling every DBX_* through pkg/config gives
consumers one injection point, lets the container manager receive its
configuration instead of sniffing for it, and fixes the create flags
whose Usage advertised a default the env-set value was already
shadowing.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Replace four fmt.Print*/Fprintf calls in pkg/commands/rm.go with a
printer field on RmCommand, converting warnUnknownContainers and
findExportedDesktopApps to methods. cli/rm, assemble, and ephemeral
propagate the new constructor arg so library users can control output.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Shell distrobox-create:204 prints `default: $(uname -n)`. Compute it
via os.Hostname() at command-build time so --help mirrors the shell.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Value: cfg.DefaultContainerImage made cmd.String("image") never empty,
which killed the `containerImage == ""` branch in makeContainerImage
and spuriously triggered the `name == default` fallback for `--name foo`
alone. The Usage string already shows the default.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
strings.Contains(container.Status, "Up") missed podman's lowercase
"running" status, leaving the force prompt unreachable under podman.
IsRunning() matches both docker ("Up …") and podman ("running").
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
`distrobox create --image alpine my-box` silently ignored the
positional; only --name was read. Override ContainerName from
cmd.Args().First() to match the shell (distrobox-create:453-461).
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
dryRun was misrouted into RmOptions.NoTTY, so `assemble rm --dry-run`
and `assemble create --replace --dry-run` actually deleted containers.
Match the shell which skips rm entirely (distrobox-assemble:316-319).
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>