func basics(c *cli.Context) error { if c.NArg() == 0 { return errors.New("no resume specified") } location := c.Args().Get(c.NArg() - 1) resume, err := dresh.FetchResume(location) if err != nil { return err } fmt.Println(dresh.BoxWrap(resume.Basics.Header(), resume.Basics.Content())) return nil }
func work(c *cli.Context) error { if c.NArg() == 0 { return errors.New("no resume specified") } location := c.Args().Get(c.NArg() - 1) resume, err := dresh.FetchResume(location) if err != nil { return err } career := resume.Work last := c.Int("last") if last != 0 { date := time.Now().AddDate(-1*last, 0, 0) career = career.Since(date) } since := c.String("since") if since != "" { date, err := time.Parse(dresh.DateLayout, since) if err != nil { return err } career = career.Since(date) } with := c.String("with") if with != "" { skills := strings.Split(with, ",") career = career.WorkingWith(skills) } for _, work := range career { fmt.Println(dresh.BoxWrap(work.Header(), work.Content())) } return nil }