issue/pr comment: allow using editor in non-interactive mode

The user should be able to `gh config set prompt disabled` and still be
allowed to use `gh issue comment --editor`.
This commit is contained in:
Mislav Marohnić 2022-02-18 17:12:43 +01:00
parent 57f49d9f8a
commit 0f1aaae57c

View file

@ -68,10 +68,6 @@ func CommentablePreRun(cmd *cobra.Command, opts *CommentableOptions) error {
return cmdutil.FlagErrorf("flags required when not running interactively")
}
opts.Interactive = true
} else if inputFlags == 1 {
if !opts.IO.CanPrompt() && opts.InputType == InputTypeEditor {
return cmdutil.FlagErrorf("`--body`, `--body-file` or `--web` required when not running interactively")
}
} else if inputFlags > 1 {
return cmdutil.FlagErrorf("specify only one of `--body`, `--body-file`, `--editor`, or `--web`")
}