diff --git a/commands/push.go b/commands/push.go index acd3c5557d4df675220963641674dfb81bc8c6af..01bba11a6e5decf1e8e613aa81c2cf8f39e07f2e 100644 --- a/commands/push.go +++ b/commands/push.go @@ -1,6 +1,7 @@ package commands import ( + "fmt" "os" "strings" "github.com/jingweno/gh/utils" @@ -33,8 +34,12 @@ func pushToEveryRemote (args *Args) { for _, i := range remotes { copyArgs := args copyArgs.ReplaceParam(idx, i) - err := copyArgs.ToCmd().Exec() - utils.Check(err) + if !args.Noop { + err := copyArgs.ToCmd().Exec() + utils.Check(err) + } else { + fmt.Printf("it would run `git push %s`\n", strings.Join(copyArgs.Params, " ")) + } } fixHelp(args)