Skip to content

Commit

Permalink
Explain what asteriks means
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Sep 16, 2024
1 parent 00e1047 commit e6bdd0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion internal/cmd/beta/list_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package beta
import (
"bytes"
"encoding/json"
"fmt"
"strings"

"github.com/cli/go-gh/v2/pkg/jsonpretty"
Expand Down Expand Up @@ -119,7 +120,14 @@ func renderTasksAsTableForCmd(cmd *cobra.Command, tasks []project.Task) error {
table.EndRow()
}

return errors.WithStack(table.Render())
err = errors.WithStack(table.Render())

if !term.IsTTY() {
return err
}

_, _ = fmt.Fprintf(term.ErrOut(), "\n*) Included when running all via \"run --all\"\n")
return err
}

// TODO(adamb): output should be well-defined. It's questionable whether
Expand Down
10 changes: 9 additions & 1 deletion internal/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"bytes"
"encoding/json"
"fmt"
"strings"

"github.com/cli/cli/v2/pkg/iostreams"
Expand Down Expand Up @@ -70,7 +71,14 @@ func listCmd() *cobra.Command {
rows = append(rows, r)
}
if !formatJSON {
return displayTable(io, rows)
err := displayTable(io, rows)

if !io.IsStderrTTY() {
return err
}

_, _ = fmt.Fprintf(io.ErrOut, "\n*) Included when running all via \"run --all\"\n")
return err
}

return displayJSON(io, rows)
Expand Down

0 comments on commit e6bdd0d

Please sign in to comment.