Skip to content

Commit ef2b145

Browse files
committed
docs: add renames to v3 migration doc
1 parent de2b0d1 commit ef2b145

File tree

1 file changed

+106
-18
lines changed

1 file changed

+106
-18
lines changed

docs/migrate-v2-to-v3.md

Lines changed: 106 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,112 @@ Check each file for this and make the change.
2323

2424
Shell command to find them all: `fgrep -rl github.com/urfave/cli/v2 *`
2525

26+
## New Names
27+
28+
### cli.App
29+
30+
=== "v2"
31+
32+
```go
33+
cli.App{
34+
// ...
35+
}
36+
```
37+
38+
=== "v3"
39+
40+
```go
41+
cli.Command{
42+
// ...
43+
}
44+
```
45+
46+
### cli.App.EnableBashCompletion
47+
48+
=== "v2"
49+
50+
```go
51+
cli.App{
52+
EnableBashCompletion: true,
53+
}
54+
```
55+
56+
=== "v3"
57+
58+
```go
59+
cli.Command{
60+
EnableShellCompletion: true,
61+
}
62+
```
63+
64+
### cli.App.CustomAppHelpTemplate
65+
66+
=== "v2"
67+
68+
```go
69+
cli.App{
70+
CustomAppHelpTemplate: "...",
71+
}
72+
```
73+
74+
=== "v3"
75+
76+
```go
77+
cli.Command{
78+
CustomRootCommandHelpTemplate: "...",
79+
}
80+
```
81+
82+
### cli.App.RunContext
83+
84+
=== "v2"
85+
86+
```go
87+
(&cli.App{}).RunContext(context.Background(), os.Args)
88+
```
89+
90+
=== "v3"
91+
92+
```go
93+
(&cli.Command{}).Run(context.Background(), os.Args)
94+
```
95+
96+
### cli.App.BashComplete
97+
98+
=== "v2"
99+
100+
```go
101+
cli.App{
102+
BashComplete: func(ctx *cli.Context) {},
103+
}
104+
```
105+
106+
=== "v3"
107+
108+
```go
109+
cli.Command{
110+
ShellComplete: func(ctx context.Context, cmd *cli.Command) {},
111+
}
112+
```
113+
114+
### cli.Command.Subcommands
115+
116+
=== "v2"
117+
118+
```go
119+
cli.Command{
120+
Subcommands: []*cli.Command{},
121+
}
122+
```
123+
124+
=== "v3"
125+
126+
```go
127+
cli.Command{
128+
Commands: []*cli.Command{},
129+
}
130+
```
131+
26132
## Sources
27133

28134
### FilePath
@@ -295,21 +401,3 @@ Similar messages would be shown for other funcs.
295401
},
296402
}
297403
```
298-
299-
## BashCompletion/ShellCompletion
300-
301-
=== "v2"
302-
303-
```go
304-
&cli.App{
305-
EnableBashCompletion: true,
306-
}
307-
```
308-
309-
=== "v3"
310-
311-
```go
312-
&cli.Command{
313-
EnableShellCompletion: true,
314-
}
315-
```

0 commit comments

Comments
 (0)