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
+6 -5
View File
@@ -6,6 +6,7 @@
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
@@ -13,7 +14,7 @@ import (
"path/filepath"
"syscall"
"github.com/urfave/cli"
"github.com/urfave/cli/v3"
"github.com/opencontainers/runtime-spec/specs-go"
)
@@ -102,12 +103,12 @@ func remapRootfs(root string, uidMap, gidMap []specs.LinuxIDMapping) error {
}
func main() {
app := cli.NewApp()
app := &cli.Command{}
app.Name = "remap-rootfs"
app.Usage = usage
app.Action = func(ctx *cli.Context) error {
args := ctx.Args()
app.Action = func(_ context.Context, cmd *cli.Command) error {
args := cmd.Args().Slice()
if len(args) != 1 {
return errors.New("exactly one bundle argument must be provided")
}
@@ -141,7 +142,7 @@ func main() {
return remapRootfs(rootfs, uidMap, gidMap)
}
if err := app.Run(os.Args); err != nil {
if err := app.Run(context.Background(), os.Args); err != nil {
fmt.Fprintln(os.Stderr, "error:", err)
os.Exit(1)
}