chore(deps): upgrade urfave/cli from v1 to v3

Migrate from urfave/cli v1 (maintenance mode) to v3 to benefit from
active development, improved features, and long-term support.

Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
lifubang
2026-03-18 03:00:21 +00:00
parent 84762a5c1a
commit 57fad01d52
124 changed files with 8429 additions and 13736 deletions
+8 -5
View File
@@ -1,6 +1,7 @@
package main
import (
"context"
"encoding/json"
"fmt"
@@ -11,10 +12,10 @@ import (
runcfeatures "github.com/opencontainers/runc/types/features"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-spec/specs-go/features"
"github.com/urfave/cli"
"github.com/urfave/cli/v3"
)
var featuresCommand = cli.Command{
var featuresCommand = &cli.Command{
Name: "features",
Usage: "show the enabled features",
ArgsUsage: "",
@@ -22,8 +23,10 @@ var featuresCommand = cli.Command{
The result is parsable as a JSON.
See https://github.com/opencontainers/runtime-spec/blob/main/features.md for the type definition.
`,
Action: func(context *cli.Context) error {
if err := checkArgs(context, 0, exactArgs); err != nil {
// Disable comma as separator for slice flags.
DisableSliceFlagSeparator: true,
Action: func(_ context.Context, cmd *cli.Command) error {
if err := checkArgs(cmd, 0, exactArgs); err != nil {
return err
}
@@ -93,7 +96,7 @@ var featuresCommand = cli.Command{
feat.Annotations[runcfeatures.AnnotationLibseccompVersion] = fmt.Sprintf("%d.%d.%d", major, minor, patch)
}
enc := json.NewEncoder(context.App.Writer)
enc := json.NewEncoder(cmd.Writer)
enc.SetIndent("", " ")
return enc.Encode(feat)
},