INNER CODE UNIT · Go
newGraphCommand
gameknife/gkNextEngine · tools/gnb/cmd/gnb/main.go:439
func newGraphCommand(ctx appContext) *cobra.Command {
opts := targetgraph.Options{}
all := false
cmd := &cobra.Command{
Use: "graph [target]",
Short: "Export a CMake target dependency graph",
Long: "Export CMake's target dependency graph as SVG/PNG/PDF/DOT.\n\n" +
"Examples:\n" +
" gnb graph gkNextEditor\n" +
" gnb graph gkNextRenderer --format dot\n" +
" gnb graph gkNextEngine --dependers\n" +
" gnb graph --all --format svg",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if all && len(args) == 1 {
return fmt.Errorf("--all cannot be combined with a target")
}
if len(args) == 1 {