Documentation
¶
Index ¶
- Variables
- func AskForConfirmationMust(s string) bool
- func EnsureDirectoryExists(path string) error
- func GetDataDirectory() string
- func InSliceString(i string, s []string) bool
- func PrintNoteColored(notes *note.Note, titleOnly bool)
- func PrintNotes(notes []*note.Note, format string) error
- func PrintNotesCSV(notes []*note.Note) error
- func PrintNotesColored(notes []*note.Note, titleOnly bool)
- func PrintNotesIDs(notes []*note.Note)
- func PrintNotesJSON(notes []*note.Note) error
- type Editor
Constants ¶
This section is empty.
Variables ¶
var ( FgBlack = color.New(color.FgBlack).SprintFunc() FgRed = color.New(color.FgRed).SprintFunc() FgGreen = color.New(color.FgGreen).SprintFunc() FgYellow = color.New(color.FgYellow).SprintFunc() FgBlue = color.New(color.FgBlue).SprintFunc() FgMagenta = color.New(color.FgMagenta).SprintFunc() FgCyan = color.New(color.FgCyan).SprintFunc() FgWhite = color.New(color.FgWhite).SprintFunc() FgHiBlack = color.New(color.FgHiBlack).SprintFunc() FgHiRed = color.New(color.FgHiRed).SprintFunc() FgHiGreen = color.New(color.FgHiGreen).SprintFunc() FgHiYellow = color.New(color.FgHiYellow).SprintFunc() FgHiBlue = color.New(color.FgHiBlue).SprintFunc() FgHiMagenta = color.New(color.FgHiMagenta).SprintFunc() FgHiCyan = color.New(color.FgHiCyan).SprintFunc() FgHiWhite = color.New(color.FgHiWhite).SprintFunc() BgBlack = color.New(color.BgBlack).SprintFunc() BgRed = color.New(color.BgRed).SprintFunc() BgGreen = color.New(color.BgGreen).SprintFunc() BgYellow = color.New(color.BgYellow).SprintFunc() BgBlue = color.New(color.BgBlue).SprintFunc() BgMagenta = color.New(color.BgMagenta).SprintFunc() BgCyan = color.New(color.BgCyan).SprintFunc() BgWhite = color.New(color.BgWhite).SprintFunc() BgHiBlack = color.New(color.BgHiBlack).SprintFunc() BgHiRed = color.New(color.BgHiRed).SprintFunc() BgHiGreen = color.New(color.BgHiGreen).SprintFunc() BgHiYellow = color.New(color.BgHiYellow).SprintFunc() BgHiBlue = color.New(color.BgHiBlue).SprintFunc() BgHiMagenta = color.New(color.BgHiMagenta).SprintFunc() BgHiCyan = color.New(color.BgHiCyan).SprintFunc() BgHiWhite = color.New(color.BgHiWhite).SprintFunc() )
Terminal Colors
Functions ¶
func AskForConfirmationMust ¶
AskForConfirmationMust asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func EnsureDirectoryExists ¶
EnsureDirectoryExists ensures that path exists
func GetDataDirectory ¶
func GetDataDirectory() string
GetDataDirectory returns the default directory for storing user data
func InSliceString ¶
InSliceString returns true if string i is in slice s
func PrintNoteColored ¶
PrintNoteColored prints the Note to stdout in color
func PrintNotes ¶
PrintNotes prints notes in the given format
func PrintNotesCSV ¶
PrintNotesCSV prints Notes in csv format
func PrintNotesColored ¶
PrintNotesColored prints the list of Notes to stdout in color
func PrintNotesJSON ¶
PrintNotesJSON prints Notes in json format
Types ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor provides an interface to open text editors and retrieve the text entered
func (*Editor) Open ¶
Open opens a text editor specified by defaultEditor (overridden by editorEnvVariable) Than waits for it to close and saves the text that was entered.