Skip to content

Commit

Permalink
fix: Missing argument [command] in non-interactive command tip (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoquec authored Nov 20, 2023
1 parent fde2f43 commit 3c3da4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
- mimatache
- muandane
- SputNikPlop
- Yoquec

0 comments on commit 3c3da4c

Please sign in to comment.