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>
Rootless podman/docker create now mounts /dev/null:/run/.distrobox.rootless:ro
(distrobox-create:577), so distrobox-init skips the /etc/shadow heuristic that
false-positives on Docker Desktop/macOS.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Thread RemoveHome into removeContainer; only prompt to delete the custom
home when --rm-home is set, interactive, and it differs from the host
home matching the shell. Without the flag the home is never touched.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Map the reference key `volume` (alongside `volumes`) and whitespace-split
the value so `volume="/a:/b /c:/d"` becomes separate mounts, matching
distrobox-assemble.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
The DE (at least Gnome and KDE) tries to match the app_id of
the running application with the corresponding .desktop file in this order:
- find ${app_id}.desktop
- if not found, tries to find a .desktop with StartupWMClass=${app_id}
Because when exporting a application we change the name of the .desktop
file, the DE can't match the running app, displaying a generic icon.
To solve this, change StartupWMClass key of the exported .desktop file
to the name of the .desktop inside distrobox (minus the .desktop extension).
When `--additional-flags --label=manager=...` overrides the manager
label at creation time, `distrobox list` would hide the container and
`distrobox rm` would silently no-op (it filters through the same list).
Match the distrobox.* label set alongside `manager` so containers
remain detectable when the manager label is overridden, restoring v1's
loose `*distrobox*` substring behavior.