refactor: urfave v3

This commit is contained in:
2024-07-09 13:57:54 +02:00
parent 375e17a4a0
commit 1f8662cd95
336 changed files with 7332 additions and 25145 deletions

View File

@ -1,10 +1,11 @@
package internal
import (
"context"
"os"
"coopcloud.tech/abra/pkg/log"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"
)
// Secrets stores the variable from SecretsFlag
@ -74,7 +75,7 @@ var Chaos bool
var ChaosFlag = &cli.BoolFlag{
Name: "chaos",
Aliases: []string{"C"},
Usage: "Proceed with uncommitted recipes changes. Use with care!",
Usage: "Ignore uncommitted recipes changes. Use with care!",
Destination: &Chaos,
}
@ -116,7 +117,7 @@ var OfflineFlag = &cli.BoolFlag{
Name: "offline",
Aliases: []string{"o"},
Destination: &Offline,
Usage: "Prefer offline & filesystem access when possible",
Usage: "Prefer offline & filesystem access",
}
// ReleaseNotes stores the variable from ReleaseNotesFlag.
@ -138,7 +139,7 @@ var MachineReadableFlag = &cli.BoolFlag{
Name: "machine",
Aliases: []string{"m"},
Destination: &MachineReadable,
Usage: "Output in a machine-readable format (where supported)",
Usage: "Machine-readable output",
}
// RC signifies the latest release candidate
@ -319,7 +320,7 @@ var AllServicesFlag = &cli.BoolFlag{
}
// SubCommandBefore wires up pre-action machinery (e.g. --debug handling).
func SubCommandBefore(c *cli.Context) error {
func SubCommandBefore(ctx context.Context, cmd *cli.Command) error {
if Debug {
log.SetLevel(log.DebugLevel)
log.SetOutput(os.Stderr)