Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &Z.Cmd{ Name: "new", Summary: "creates a new list", Commands: []*Z.Cmd{ help.Cmd, }, Call: func(_ *Z.Cmd, args ...string) error { listDir := os.Getenv("LISTDIR") if listDir == "" { return errors.New("LISTDIR not set") } files, err := list.List() if err != nil { return err } listName := "" prompt := &survey.Input{ Message: "Name of the list:", } survey.AskOne(prompt, &listName) for file, _ := range files { if file == listName { return fmt.Errorf("list %s already exists", listName) } } path := fmt.Sprintf("%s/%s", listDir, listName+".md") _, err = os.Create(path) if err != nil { return err } return nil }, }
rootCmd is the main command for the list command line tool its just holds all the other useful commands
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.