Skip to content

Commit aaba279

Browse files
Support "-" in -o
1 parent 361b26d commit aaba279

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/cli/gptscript.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type GPTScript struct {
3131
DisplayOptions
3232
Debug bool `usage:"Enable debug logging"`
3333
Quiet bool `usage:"No output logging" short:"q"`
34-
Output string `usage:"Save output to a file" short:"o"`
34+
Output string `usage:"Save output to a file, or - for stdout" short:"o"`
3535
Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f"`
3636
SubTool string `usage:"Use tool of this name, not the first tool in file"`
3737
Assemble bool `usage:"Assemble tool to a single artifact, saved to --output"`
@@ -129,7 +129,7 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) error {
129129

130130
if r.Assemble {
131131
var out io.Writer = os.Stdout
132-
if r.Output != "" {
132+
if r.Output != "" && r.Output != "-" {
133133
f, err := os.Create(r.Output)
134134
if err != nil {
135135
return fmt.Errorf("opening %s: %w", r.Output, err)

0 commit comments

Comments
 (0)