fixing gh gist view prompts with no TTY

This commit is contained in:
Mateus Marquezini 2024-12-09 08:35:01 -03:00
parent d60e5ffba3
commit cbaaf77822

View file

@ -55,7 +55,7 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman
}
if !opts.IO.IsStdoutTTY() {
opts.Raw = true
return cmdutil.FlagErrorf("run or gist ID required when not running interactively\n\nUsage: gh gist view [<id> | <url>] [flags]\n\nFlags:\n -f, --filename string Display a single file from the gist\n --files List file names from the gist\n -r, --raw Print raw instead of rendered gist contents\n -w, --web Open gist in the browser\n")
}
if runF != nil {