Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "summary [optional cid1,cid2,...]", Short: "Get a summary about the current storage and jobs state of cids", Long: `Get a summary about the current storage and jobs state of cids`, Args: cobra.MaximumNArgs(1), PreRun: func(cmd *cobra.Command, args []string) { err := viper.BindPFlags(cmd.Flags()) c.CheckErr(err) }, Run: func(cmd *cobra.Command, args []string) { var cids []string if len(args) > 0 { cids = strings.Split(args[0], ",") } json := viper.GetBool("json") if json { res, err := getSummary(cids) c.CheckErr(err) json, err := protojson.MarshalOptions{Multiline: true, Indent: " ", EmitUnpopulated: true}.Marshal(res) c.CheckErr(err) fmt.Println(string(json)) return } p := tea.NewProgram(model{cids: cids}) if err := p.Start(); err != nil { fmt.Printf("Alas, there's been an error: %v", err) os.Exit(1) } }, }
Cmd is the command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.