cmd/timelines.go
changeset 13 f862af8faf17
parent 0 5abace724584
child 20 b0ccc09f07a2
--- a/cmd/timelines.go	Sun Apr 23 22:40:52 2017 +0200
+++ b/cmd/timelines.go	Sun Apr 23 23:32:16 2017 +0200
@@ -11,6 +11,7 @@
 
 var timelineOpts struct {
 	local bool
+	limit uint
 }
 
 // timelineCmd represents the timelines command
@@ -33,6 +34,7 @@
 	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")
 }
 
 func timelineRunE(cmd *cobra.Command, args []string) error {
@@ -54,6 +56,10 @@
 		return nil
 	}
 
+	if opt.limit > 0 {
+		sl = sl[:opt.limit]
+	}
+
 	p, err := getPrinter()
 	if err != nil {
 		return err