Add --fields
to notification & milestone listings #422
|
@ -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":
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user