equal
deleted
inserted
replaced
24 spoiler string |
24 spoiler string |
25 inReplyToID int |
25 inReplyToID int |
26 filePath string |
26 filePath string |
27 mediaIDs string |
27 mediaIDs string |
28 |
28 |
29 // TODO |
29 // Used for several subcommands to limit the number of results |
30 limit int |
30 limit uint |
31 } |
31 } |
32 |
32 |
33 func init() { |
33 func init() { |
34 RootCmd.AddCommand(statusCmd) |
34 RootCmd.AddCommand(statusCmd) |
35 |
35 |
36 // Subcommands |
36 // Subcommands |
37 statusCmd.AddCommand(statusSubcommands...) |
37 statusCmd.AddCommand(statusSubcommands...) |
38 |
38 |
39 // Global flags |
39 // Global flags |
40 statusCmd.PersistentFlags().IntVarP(&statusOpts.statusID, "status-id", "s", 0, "Status ID number") |
40 statusCmd.PersistentFlags().IntVarP(&statusOpts.statusID, "status-id", "s", 0, "Status ID number") |
41 //statusCmd.PersistentFlags().IntVarP(&statusOpts.limit, "limit", "l", 0, "Limit number of results") |
41 statusCmd.PersistentFlags().UintVarP(&statusOpts.limit, "limit", "l", 0, "Limit number of results") |
42 |
42 |
43 statusCmd.MarkPersistentFlagRequired("status-id") |
43 statusCmd.MarkPersistentFlagRequired("status-id") |
44 |
44 |
45 // Subcommand flags |
45 // Subcommand flags |
46 statusReblogSubcommand.Flags().BoolVar(&statusOpts.unset, "unset", false, "Unreblog the status") |
46 statusReblogSubcommand.Flags().BoolVar(&statusOpts.unset, "unset", false, "Unreblog the status") |
173 context, err = gClient.GetStatusCard(opt.statusID) |
173 context, err = gClient.GetStatusCard(opt.statusID) |
174 obj = context |
174 obj = context |
175 case "reblogged-by": |
175 case "reblogged-by": |
176 var accountList []madon.Account |
176 var accountList []madon.Account |
177 accountList, err = gClient.GetStatusRebloggedBy(opt.statusID) |
177 accountList, err = gClient.GetStatusRebloggedBy(opt.statusID) |
|
178 if opt.limit > 0 { |
|
179 accountList = accountList[:opt.limit] |
|
180 } |
178 obj = accountList |
181 obj = accountList |
179 case "favourited-by": |
182 case "favourited-by": |
180 var accountList []madon.Account |
183 var accountList []madon.Account |
181 accountList, err = gClient.GetStatusFavouritedBy(opt.statusID) |
184 accountList, err = gClient.GetStatusFavouritedBy(opt.statusID) |
|
185 if opt.limit > 0 { |
|
186 accountList = accountList[:opt.limit] |
|
187 } |
182 obj = accountList |
188 obj = accountList |
183 case "delete": |
189 case "delete": |
184 err = gClient.DeleteStatus(opt.statusID) |
190 err = gClient.DeleteStatus(opt.statusID) |
185 case "boost": |
191 case "boost": |
186 if opt.unset { |
192 if opt.unset { |