Skip to content

Conversation

@dirkmueller
Copy link
Member

app.go: cli.App -> cli.Command, cli.NewApp() -> &cli.Command{}

Function Signature Changes

  • BeforeFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) (context.Context, error)
  • AfterFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) error
  • ActionFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) error
  • ctx.App.Metadata -> cmd.Root().Metadata
  • ctx.Bool("flag") -> cmd.Bool("flag")
  • ctx.String("flag") -> cmd.String("flag")
  • ctx.Context -> ctx (the context.Context parameter)
  • app.Run(os.Args) -> cmd.Run(context.Background(), os.Args)
  • Replaced cli.NewContext(cli.NewApp(), nil, &cli.Context{}) with &cli.Command{Metadata: map[string]any{}}
  • Updated action calls to use action.Xxx(context.Background(), cliCmd)

app.go: cli.App -> cli.Command, cli.NewApp() -> &cli.Command{}

Function Signature Changes

- BeforeFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) (context.Context, error)
- AfterFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) error
- ActionFunc: func(*cli.Context) error -> func(context.Context, *cli.Command) error
- ctx.App.Metadata -> cmd.Root().Metadata
- ctx.Bool("flag") -> cmd.Bool("flag")
- ctx.String("flag") -> cmd.String("flag")
- ctx.Context -> ctx (the context.Context parameter)
- app.Run(os.Args) -> cmd.Run(context.Background(), os.Args)
- Replaced cli.NewContext(cli.NewApp(), nil, &cli.Context{}) with &cli.Command{Metadata: map[string]any{}}
- Updated action calls to use action.Xxx(context.Background(), cliCmd)
@dirkmueller dirkmueller requested a review from a team as a code owner January 22, 2026 10:54
Copy link
Contributor

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants