Feat: interactive issue edit command (#708)

If there are no flags passed to the `issues edit` command, it prompts
for changes to the properties like title, description, labels, etc.

This is a follow-up to <https://gitea.com/gitea/tea/pulls/506>.

Closes: <https://gitea.com/gitea/tea/issues/605>
Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/708
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: Vincent Neubauer <v.neubauer@darlor.de>
Co-committed-by: Vincent Neubauer <v.neubauer@darlor.de>
This commit is contained in:
Vincent Neubauer
2025-02-27 18:49:24 +00:00
committed by techknowlogick
parent 60636cd7d8
commit 57e3400f0f
5 changed files with 181 additions and 11 deletions

View File

@ -8,6 +8,7 @@ import (
"code.gitea.io/tea/cmd/flags"
"code.gitea.io/tea/modules/context"
"code.gitea.io/tea/modules/interact"
"code.gitea.io/tea/modules/print"
"code.gitea.io/tea/modules/task"
"code.gitea.io/tea/modules/utils"
@ -47,6 +48,14 @@ func runIssuesEdit(cmd *cli.Context) error {
client := ctx.Login.Client()
for _, opts.Index = range indices {
if ctx.NumFlags() == 0 {
var err error
opts, err = interact.EditIssue(*ctx, opts.Index)
if err != nil {
return err
}
}
issue, err := task.EditIssue(ctx, client, *opts)
if err != nil {
return err