示例#1
0
func profilePath(c *cli.Context) string {
	p := metaFilePath(".", "config")
	if c.String("profile-path") != "" {
		return c.String("profile-path")
	}
	return p
}
示例#2
0
文件: log.go 项目: ssmi1975/kii-cli
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",
	}
}