Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CatCmd = &cobra.Command{ Use: "cat", Short: "simple cat program for canvas (wip)", RunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 { canvasFilePath = args[0] } r, err := canvas_tools.NewRepo(canvasFilePath) if err != nil { return fmt.Errorf("can't open repo: %w", err) } c, err := r.One() if err != nil { return fmt.Errorf("can't get one canvas: %w", err) } spew.Dump(c) return nil }, }
View Source
var Cmd = &cobra.Command{ Use: "canvas", Short: "canvas utils", Run: func(cmd *cobra.Command, args []string) { _ = cmd.Help() }, }
View Source
var StatCmd = &cobra.Command{ Use: "stat", Short: "show some canvas stats", RunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 { canvasFilePath = args[0] } r, err := canvas_tools.NewRepo(canvasFilePath) if err != nil { return fmt.Errorf("can't open repo: %w", err) } c, err := r.One() if err != nil { return fmt.Errorf("can't get one canvas: %w", err) } fmt.Printf("Canvas: %s\n", filepath.Base(canvasFilePath)) fmt.Printf("\tNodes: %d\n", len(c.Nodes)) fmt.Print(nodeDetails(c)) fmt.Printf("\tEdges: %d\n", len(c.Edges)) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.