mirror of
https://github.com/89luca89/distrobox.git
synced 2026-11-02 20:30:16 -06:00
fix(create): honor positional container_name argument
`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>
This commit is contained in:
1 file changed
+7
@@ -223,6 +223,13 @@ func createAction(ctx context.Context, cmd *cli.Command, cfg *config.Values) err
|
||||
NonInteractive: cmd.Bool("yes"),
|
||||
}
|
||||
|
||||
// Positional container_name overrides --name, matching the shell
|
||||
// (distrobox-create:453-461) so `distrobox create --image alpine my-box`
|
||||
// names the box `my-box`.
|
||||
if positional := cmd.Args().First(); positional != "" {
|
||||
opts.ContainerName = positional
|
||||
}
|
||||
|
||||
progress := ui.NewProgress(os.Stderr)
|
||||
prompter := ui.NewPrompter(*bufio.NewReader(os.Stdin), os.Stdout)
|
||||
|
||||
|
||||
Reference in new issue
Block a user