func actionUpload(c *cli.Context) { mi, err := machine.DefaultIdentifier() if err != nil { fmt.Fprintf(os.Stderr, "Could not create default machine identifier") return } u, err := url.Parse(c.String(uploadFlagDest.Name)) if err != nil { fmt.Fprintf(os.Stderr, "Destination needs to be a valid url") return } crashDir := c.String(uploadFlagCrashDir.Name) persister := crash.HttpReportPersister{*u, mi, &http.Client{}} crash.ForEachReportInDir(crashDir, UploadingVisitor{crashDir, os.Stdout, persister, c.Bool(uploadFlagCleanup.Name)}) }
func actionList(c *cli.Context) { crashDir := c.String(listFlagCrashDir.Name) fmt.Fprintf(os.Stdout, "Listing crash reports in %s:\n", crashDir) crash.ForEachReportInDir(crashDir, ListingVisitor{os.Stdout}) }