// PromptUserForConfig is a part of loader.ConfigContainer interface. func (local *LocalConfig) PromptUserForConfig() error { c := LocalConfig{spec: local.spec} // Prompt for the state labels. if err := prompt.Dialog(&c, "Insert the"); err != nil { return err } // Prompt for the story labels. storyLabels, err := promptForLabelList("Insert the story labels", DefaultStoryLabels, nil) fmt.Println() if err != nil { return err } c.StoryLabels = storyLabels // Prompt for the release skip check labels. skipCheckLabels, err := promptForLabelList( "Insert the skip release check labels", nil, ImplicitSkipCheckLabels) if err != nil { return err } c.SkipCheckLabels = skipCheckLabels // Success! *local = c return nil }
// PromptUserForConfig is a part of loader.ConfigContainer func (global *GlobalConfig) PromptUserForConfig() error { var c GlobalConfig if err := prompt.Dialog(&c, "Insert your"); err != nil { return err } *global = c return nil }
// PromptUserForConfig is a part of loader.ConfigContainer interface. func (local *LocalConfig) PromptUserForConfig() error { task := "Prompt the user for local Git-related configuration" var c LocalConfig if err := prompt.Dialog(&c, "Insert the"); err != nil { return errs.NewError(task, err) } *local = c return nil }
func (local *LocalConfig) PromptUserForConfig() error { task := "Prompt the user for local versioning-related configuration" for { var c LocalConfig if err := prompt.Dialog(&c, "Insert the"); err != nil { return errs.NewError(task, err) } if _, err := c.parse(); err != nil { fmt.Println() color.Yellow("Invalid version suffix inserted, please try again!") fmt.Println() continue } *local = c return nil } }