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
+9 -6
View File
@@ -1,15 +1,16 @@
package main
import (
"context"
"errors"
"fmt"
"os"
"github.com/opencontainers/runc/libcontainer"
"github.com/urfave/cli"
"github.com/urfave/cli/v3"
)
var startCommand = cli.Command{
var startCommand = &cli.Command{
Name: "start",
Usage: "executes the user defined process in a created container",
ArgsUsage: `<container-id>
@@ -18,11 +19,13 @@ Where "<container-id>" is your name for the instance of the container that you
are starting. The name you provide for the container instance must be unique on
your host.`,
Description: `The start command executes the user defined process in a created container.`,
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
// Disable comma as separator for slice flags.
DisableSliceFlagSeparator: true,
Action: func(_ context.Context, cmd *cli.Command) error {
if err := checkArgs(cmd, 1, exactArgs); err != nil {
return err
}
container, err := getContainer(context)
container, err := getContainer(cmd)
if err != nil {
return err
}
@@ -32,7 +35,7 @@ your host.`,
}
switch status {
case libcontainer.Created:
notifySocket, err := notifySocketStart(context, os.Getenv("NOTIFY_SOCKET"), container.ID())
notifySocket, err := notifySocketStart(cmd, os.Getenv("NOTIFY_SOCKET"), container.ID())
if err != nil {
return err
}