Documentation ¶
Index ¶
- Variables
- func CmdGet(c *cli.Context) error
- func CmdInit(c *cli.Context) error
- func Exists(filename string) bool
- type BetweenTimestamps
- type Lines
- type TimeDurationParser
- func (s *TimeDurationParser) GetDay() BetweenTimestamps
- func (s *TimeDurationParser) GetToday() BetweenTimestamps
- func (s *TimeDurationParser) GetWeek() BetweenTimestamps
- func (s *TimeDurationParser) GetYear() BetweenTimestamps
- func (s *TimeDurationParser) GetYesterday() BetweenTimestamps
- func (s *TimeDurationParser) IsDay() bool
- func (s *TimeDurationParser) IsToday() bool
- func (s *TimeDurationParser) IsWeek() bool
- func (s *TimeDurationParser) IsYear() bool
- func (s *TimeDurationParser) IsYesterday() bool
- func (s *TimeDurationParser) Parse() BetweenTimestamps
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdGetCommand = &cli.Command{ Name: "get", Usage: "Get abarge commit log formatted from .dailylog", Action: CmdGet, Flags: []cli.Flag{ &cli.StringFlag{ Name: "author", Value: "", Usage: "commit author filter", }, &cli.BoolFlag{ Name: "reverse", Usage: "reverse output", }, }, }
View Source
var CmdInitCommand = &cli.Command{ Name: "init", Usage: "Initialize dailylog fotmat file. format reference: https://git-scm.com/docs/pretty-formats", Action: CmdInit, Flags: []cli.Flag{}, }
View Source
var Initialfile = bytes.NewBufferString("\"%h: %ad %an: %s\"")
View Source
var SelfUpdateCommand = &cli.Command{ Name: "selfupdate", Aliases: []string{"self-update"}, Usage: "latest update from server", Action: func(context *cli.Context) error { if context.Bool("verbose") { selfupdate.EnableLog() } latest, found, err := selfupdate.DetectLatest(context.App.Metadata["Slug"].(string)) if err != nil { log.Println("Error occurred while detecting version:", err) return err } v := semver.MustParse(strings.ReplaceAll(context.App.Version, "v", "")) if !found || latest.Version.LTE(v) { log.Println("Current version is the latest") return nil } fmt.Print("Do you want to update to ", latest.Version, " ? (y/n): ") input, err := bufio.NewReader(os.Stdin).ReadString('\n') if err != nil { return err } if input != "y\n" && input != "n\n" { return errors.New("Invalid input") } if input == "n\n" { return nil } exe, err := os.Executable() if err != nil { return err } if err := selfupdate.UpdateTo(latest.AssetURL, exe); err != nil { return err } log.Println("Successfully updated to version", latest.Version) return nil }, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "verbose", Aliases: []string{"v"}, Usage: "Verbose", }, }, }
Functions ¶
Types ¶
type BetweenTimestamps ¶
type TimeDurationParser ¶
type TimeDurationParser struct {
// contains filtered or unexported fields
}
func (*TimeDurationParser) GetDay ¶
func (s *TimeDurationParser) GetDay() BetweenTimestamps
func (*TimeDurationParser) GetToday ¶
func (s *TimeDurationParser) GetToday() BetweenTimestamps
func (*TimeDurationParser) GetWeek ¶
func (s *TimeDurationParser) GetWeek() BetweenTimestamps
func (*TimeDurationParser) GetYear ¶
func (s *TimeDurationParser) GetYear() BetweenTimestamps
func (*TimeDurationParser) GetYesterday ¶
func (s *TimeDurationParser) GetYesterday() BetweenTimestamps
func (*TimeDurationParser) IsDay ¶
func (s *TimeDurationParser) IsDay() bool
func (*TimeDurationParser) IsToday ¶
func (s *TimeDurationParser) IsToday() bool
func (*TimeDurationParser) IsWeek ¶
func (s *TimeDurationParser) IsWeek() bool
func (*TimeDurationParser) IsYear ¶
func (s *TimeDurationParser) IsYear() bool
func (*TimeDurationParser) IsYesterday ¶
func (s *TimeDurationParser) IsYesterday() bool
func (*TimeDurationParser) Parse ¶
func (s *TimeDurationParser) Parse() BetweenTimestamps
Click to show internal directories.
Click to hide internal directories.