Skip to content

Commit 69855b7

Browse files
committed
fix(discussion comment): fix bug in requiring body/body-file in add/edit mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent 616d929 commit 69855b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cmd/discussion/comment/comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func NewCmdComment(f *cmdutil.Factory, runF func(*CommentOptions) error) *cobra.
9595
return cmdutil.FlagErrorf("--yes is required when not running interactively with --delete")
9696
}
9797
if !opts.IO.CanPrompt() && !opts.Delete {
98-
if !cmd.Flags().Changed("body") && !cmd.Flags().Changed("body-file") {
98+
if opts.Body == "" && opts.BodyFile == "" {
9999
return cmdutil.FlagErrorf("--body or --body-file is required when not running interactively")
100100
}
101101
}

0 commit comments

Comments
 (0)