diff --git a/send.go b/send.go index bbe8753..5135a9f 100644 --- a/send.go +++ b/send.go @@ -61,11 +61,13 @@ var send = &cli.Command{ // git-format-patch extra flags that will be handled directly to it gitFormatPatchArgs := []string{"format-patch", "--stdout"} for _, fd := range gitFormatPatchFlags { - switch flag := fd.(type) { - case *cli.StringFlag: - gitFormatPatchArgs = append(gitFormatPatchArgs, "--"+flag.Name+"="+c.String(flag.Name)) - case *cli.BoolFlag: - gitFormatPatchArgs = append(gitFormatPatchArgs, "--"+flag.Name) + if fd.IsSet() { + switch flag := fd.(type) { + case *cli.StringFlag: + gitFormatPatchArgs = append(gitFormatPatchArgs, "--"+flag.Name+"="+c.String(flag.Name)) + case *cli.BoolFlag: + gitFormatPatchArgs = append(gitFormatPatchArgs, "--"+flag.Name) + } } }