cli/pkg/cmd/project/shared/format/display.go
Heath Stewart 0cf5d22ead
Support template, jq flags with standard format flag (#7832)
* Use standard JSON flags for project command

Deprecates the --format flag and adds the standard JSON flags to properly filter, template, and write JSON.

* Add format flags cmdutil

Resolves PR feedback

* Remove unnecessary fields from JSON format flags

* Add standard format help to remaining commands

* Add JSON format regression tests

Also fixed a number of `project` commands that didn't format the right object as JSON.

* Resolve PR feedback
2024-01-09 09:46:39 -08:00

19 lines
314 B
Go

package format
import (
"github.com/cli/cli/v2/pkg/cmd/project/shared/queries"
)
func ProjectState(project queries.Project) string {
if project.Closed {
return "closed"
}
return "open"
}
func ColorForProjectState(project queries.Project) string {
if project.Closed {
return "gray"
}
return "green"
}