Skip to content

Commit

Permalink
Fix panic when calling cmd.Do subsequently (sqlc-dev#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlisthood authored May 12, 2022
1 parent 708e763 commit 996a73a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import (
"github.com/kyleconroy/sqlc/internal/tracer"
)

func init() {
uploadCmd.Flags().BoolP("dry-run", "", false, "dump upload request (default: false)")
}

// Do runs the command logic.
func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int {
rootCmd := &cobra.Command{Use: "sqlc", SilenceUsage: true}
Expand All @@ -29,7 +33,6 @@ func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int
rootCmd.AddCommand(genCmd)
rootCmd.AddCommand(initCmd)
rootCmd.AddCommand(versionCmd)
uploadCmd.Flags().BoolP("dry-run", "", false, "dump upload request (default: false)")
rootCmd.AddCommand(uploadCmd)

rootCmd.SetArgs(args)
Expand Down

0 comments on commit 996a73a

Please sign in to comment.