Migrate to urfave v3 (#34510)

migrate cli to urfave v3

add more cli tests

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
TheFox0x7 2025-06-10 14:35:12 +02:00 committed by GitHub
parent 2c341b6803
commit e9f5105e95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 1718 additions and 783 deletions

View file

@ -4,13 +4,14 @@
package cmd
import (
"context"
"fmt"
"os"
"text/tabwriter"
user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"
)
var microcmdUserList = &cli.Command{
@ -25,10 +26,7 @@ var microcmdUserList = &cli.Command{
},
}
func runListUsers(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
func runListUsers(ctx context.Context, c *cli.Command) error {
if err := initDB(ctx); err != nil {
return err
}