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", } }