Skip to content

Migrate to urfave v3 #34510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
package cmd

import (
"context"
"fmt"

"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"

"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"
)

var (
// CmdActions represents the available actions sub-commands.
CmdActions = &cli.Command{
Name: "actions",
Usage: "Manage Gitea Actions",
Subcommands: []*cli.Command{
Commands: []*cli.Command{
subcmdActionsGenRunnerToken,
},
}
Expand All @@ -38,7 +39,7 @@ var (
}
)

func runGenerateActionsRunnerToken(c *cli.Context) error {
func runGenerateActionsRunnerToken(_ context.Context, c *cli.Command) error {
ctx, cancel := installSignals()
defer cancel()

Expand Down
26 changes: 13 additions & 13 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (
"code.gitea.io/gitea/modules/log"
repo_module "code.gitea.io/gitea/modules/repository"

"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"
)

var (
// CmdAdmin represents the available admin sub-command.
CmdAdmin = &cli.Command{
Name: "admin",
Usage: "Perform common administrative operations",
Subcommands: []*cli.Command{
Commands: []*cli.Command{
subcmdUser,
subcmdRepoSyncReleases,
subcmdRegenerate,
Expand All @@ -41,7 +41,7 @@ var (
subcmdRegenerate = &cli.Command{
Name: "regenerate",
Usage: "Regenerate specific files",
Subcommands: []*cli.Command{
Commands: []*cli.Command{
microcmdRegenHooks,
microcmdRegenKeys,
},
Expand All @@ -50,15 +50,15 @@ var (
subcmdAuth = &cli.Command{
Name: "auth",
Usage: "Modify external auth providers",
Subcommands: []*cli.Command{
microcmdAuthAddOauth,
microcmdAuthUpdateOauth,
microcmdAuthAddLdapBindDn,
microcmdAuthUpdateLdapBindDn,
microcmdAuthAddLdapSimpleAuth,
microcmdAuthUpdateLdapSimpleAuth,
microcmdAuthAddSMTP,
microcmdAuthUpdateSMTP,
Commands: []*cli.Command{
microcmdAuthAddOauth(),
microcmdAuthUpdateOauth(),
newMicrocmdAuthAddLdapBindDn(),
newMicrocmdAuthUpdateLdapBindDn(),
newMicrocmdAuthAddLdapSimpleAuth(),
newMicrocmdAuthUpdateLdapSimpleAuth(),
microcmdAuthAddSMTP(),
microcmdAuthUpdateSMTP(),
microcmdAuthList,
microcmdAuthDelete,
},
Expand Down Expand Up @@ -93,7 +93,7 @@ var (
}
)

func runRepoSyncReleases(_ *cli.Context) error {
func runRepoSyncReleases(_ context.Context, _ *cli.Command) error {
ctx, cancel := installSignals()
defer cancel()

Expand Down
7 changes: 4 additions & 3 deletions cmd/admin_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
"context"
"errors"
"fmt"
"os"
Expand All @@ -13,7 +14,7 @@ import (
"code.gitea.io/gitea/models/db"
auth_service "code.gitea.io/gitea/services/auth"

"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"
)

var (
Expand Down Expand Up @@ -56,7 +57,7 @@ var (
}
)

func runListAuth(c *cli.Context) error {
func runListAuth(_ context.Context, c *cli.Command) error {
ctx, cancel := installSignals()
defer cancel()

Expand Down Expand Up @@ -90,7 +91,7 @@ func runListAuth(c *cli.Context) error {
return nil
}

func runDeleteAuth(c *cli.Context) error {
func runDeleteAuth(_ context.Context, c *cli.Command) error {
if !c.IsSet("id") {
return errors.New("--id flag is missing")
}
Expand Down
Loading