* 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
19 lines
314 B
Go
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"
|
|
}
|