Exemple #1
0
func profilePath(c *cli.Context) string {
	p := metaFilePath(".", "config")
	if c.String("profile-path") != "" {
		return c.String("profile-path")
	}
	return p
}
Exemple #2
0
func getActiveVersion(c *cli.Context) string {
	ver, b := c.ArgFor("version")
	if b {
		return ver
	}
	vers := ListVersions()
	for _, v := range vers.Versions {
		if v.Active {
			return v.VersionId
		}
	}
	log.Fatalf("Missing active version")
	return ""
}
Exemple #3
0
func (s *AuthRequest) Parse(c *cli.Context) {
	//
	s.Command = "cat"
	if c.Bool("tail") {
		s.Command = "tail" //cat
	}
	//t, _ := time.Parse("2006-01-02 15:04:05", "2012-01-01 12:12:12")
	//return t.Format("2006-01-02 15:04:05")

	s.Limit = c.Int("num")
	s.UserID = c.String("user-id")
	s.Level = strings.ToUpper(c.String("level"))

	if c.String("date-from") != "" {
		s.DateFrom = c.String("date-from") //"2015-01-08:07:40:00",
	}
	if c.String("date-to") != "" {
		s.DateTo = c.String("date-to") //"2015-01-09:00:00:00",
	}
}