Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "groups", Short: "Print groups found in the .env file", RunE: func(cmd *cobra.Command, args []string) error { filename := cmd.Flag("file").Value.String() env, err := pkg.Load(filename) if err != nil { return err } groups := env.Groups if len(groups) == 0 { return errors.New("No groups found") } width := longesGroupName(groups) light := tui.Theme.Secondary.StdoutPrinter() key := tui.Theme.Primary.StdoutPrinter() info := tui.Theme.Info.StdoutPrinter() info.Box("Groups in " + filename) for _, group := range groups { key.Printf("%-"+strconv.Itoa(width)+"s", slug.Make(group.String())) key.Print(" ") light.Printfln("(%s:%d)", filename, group.Position.FirstLine) } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.