From 3c3da4c87931bd872d145de3744c3930dd9ebe5c Mon Sep 17 00:00:00 2001 From: Alvaro V <59575696+Yoquec@users.noreply.github.com> Date: Mon, 20 Nov 2023 05:04:12 +0100 Subject: [PATCH] fix: Missing argument [command] in non-interactive command tip (#123) --- cmd/create.go | 2 +- cmd/utils/utils.go | 4 ++-- contributors.yml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/create.go b/cmd/create.go index 57ffbc13..6dc6f94a 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -166,7 +166,7 @@ var createCmd = &cobra.Command{ fmt.Println(endingMsgStyle.Render(fmt.Sprintf("• cd %s\n", project.ProjectName))) if isInteractive { - nonInteractiveCommand := utils.NonInteractiveCommand(cmd.Flags()) + nonInteractiveCommand := utils.NonInteractiveCommand(cmd.Use, cmd.Flags()) fmt.Println(tipMsgStyle.Render("Tip: Repeat the equivalent Blueprint with the following non-interactive command:")) fmt.Println(tipMsgStyle.Italic(false).Render(fmt.Sprintf("• %s\n", nonInteractiveCommand))) } diff --git a/cmd/utils/utils.go b/cmd/utils/utils.go index 03d10583..bb43f129 100644 --- a/cmd/utils/utils.go +++ b/cmd/utils/utils.go @@ -14,8 +14,8 @@ const ProgramName = "go-blueprint" // NonInteractiveCommand creates the command string from a flagSet // to be used for getting the equivalent non-interactive shell command -func NonInteractiveCommand(flagSet *pflag.FlagSet) string { - nonInteractiveCommand := ProgramName +func NonInteractiveCommand(use string, flagSet *pflag.FlagSet) string { + nonInteractiveCommand := fmt.Sprintf("%s %s", ProgramName, use) visitFn := func(flag *pflag.Flag) { if flag.Name != "help" { diff --git a/contributors.yml b/contributors.yml index f71ea059..15270ecf 100644 --- a/contributors.yml +++ b/contributors.yml @@ -17,3 +17,4 @@ - mimatache - muandane - SputNikPlop +- Yoquec