cmd/timelines.go
changeset 167 1341bacd01c9
parent 110 57843255fd1a
child 185 564d92b54b00
--- a/cmd/timelines.go	Sat Jul 15 21:58:24 2017 +0200
+++ b/cmd/timelines.go	Sat Jul 15 22:25:46 2017 +0200
@@ -15,7 +15,7 @@
 
 var timelineOpts struct {
 	local          bool
-	limit          uint
+	limit, keep    uint
 	sinceID, maxID int64
 }
 
@@ -39,7 +39,8 @@
 	RootCmd.AddCommand(timelineCmd)
 
 	timelineCmd.Flags().BoolVar(&timelineOpts.local, "local", false, "Posts from the local instance")
-	timelineCmd.Flags().UintVarP(&timelineOpts.limit, "limit", "l", 0, "Limit number of results")
+	timelineCmd.Flags().UintVarP(&timelineOpts.limit, "limit", "l", 0, "Limit number of API results")
+	timelineCmd.Flags().UintVarP(&timelineOpts.keep, "keep", "k", 0, "Limit number of results")
 	timelineCmd.PersistentFlags().Int64Var(&timelineOpts.sinceID, "since-id", 0, "Request IDs greater than a value")
 	timelineCmd.PersistentFlags().Int64Var(&timelineOpts.maxID, "max-id", 0, "Request IDs less (or equal) than a value")
 }
@@ -78,8 +79,8 @@
 		os.Exit(1)
 	}
 
-	if opt.limit > 0 && len(sl) > int(opt.limit) {
-		sl = sl[:opt.limit]
+	if opt.keep > 0 && len(sl) > int(opt.keep) {
+		sl = sl[:opt.keep]
 	}
 
 	p, err := getPrinter()