Add --fields to notification & milestone listings #422

Merged
6543 merged 22 commits from noerw/tea:fields-flag into main 2022-09-13 19:08:19 +00:00
3 changed files with 5 additions and 5 deletions
Showing only changes of commit 5757645874 - Show all commits

View File

@ -50,7 +50,7 @@ func RunMilestonesList(cmd *cli.Context) error {
switch ctx.String("state") {
case "all":
state = gitea.StateAll
if !fieldsFlag.IsSet() { // add to default fields
if !cmd.IsSet("fields") { // add to default fields
fields = append(fields, "state")
}
case "closed":

View File

@ -80,7 +80,7 @@ func listNotifications(cmd *cli.Context, status []gitea.NotifyStatus, subjects [
if all {
// add repository to the default fields
if !notifFieldsFlag.IsSet() {
if !cmd.IsSet("fields") {
fields = append(fields, "repository")
}

View File

@ -28,7 +28,7 @@ var CmdNotificationsMarkRead = cli.Command{
if err != nil {
return err
}
if !flags.NotificationStateFlag.IsSet() {
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
filter = []string{string(gitea.NotifyStatusUnread)}
}
return markNotificationAs(cmd, filter, gitea.NotifyStatusRead)
@ -49,7 +49,7 @@ var CmdNotificationsMarkUnread = cli.Command{
if err != nil {
return err
}
if !flags.NotificationStateFlag.IsSet() {
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
filter = []string{string(gitea.NotifyStatusRead)}
}
return markNotificationAs(cmd, filter, gitea.NotifyStatusUnread)
@ -70,7 +70,7 @@ var CmdNotificationsMarkPinned = cli.Command{
if err != nil {
return err
}
if !flags.NotificationStateFlag.IsSet() {
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
filter = []string{string(gitea.NotifyStatusUnread)}
}
return markNotificationAs(cmd, filter, gitea.NotifyStatusPinned)