Similarly to the section above describing use of the `v2` branch, if one wants
to avoid any unexpected compatibility pains once `v2` becomes `master`, then
pinning to `v1` is an acceptable option, e.g.:
```
```
$ go get github.com/urfave/cli
$ go get github.com/urfave/cli
@ -711,6 +707,7 @@ package main
import (
import (
"fmt"
"fmt"
"log"
"os"
"os"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
@ -738,6 +735,7 @@ func main() {
#### Default Values for help output
#### Default Values for help output
<<<<<<<HEAD
Sometimes it's useful to specify a flag's default help-text value within the flag declaration. This can be useful if the default value for a flag is a computed value. The default value can be set via the `DefaultText` struct field.
Sometimes it's useful to specify a flag's default help-text value within the flag declaration. This can be useful if the default value for a flag is a computed value. The default value can be set via the `DefaultText` struct field.
For example this:
For example this:
@ -768,6 +766,8 @@ func main() {
},
},
}
}
=======
>>>>>>> master
err := app.Run(os.Args)
err := app.Run(os.Args)
if err != nil {
if err != nil {
log.Fatal(err)
log.Fatal(err)
@ -775,12 +775,15 @@ func main() {
}
}
```
```
<<<<<<<HEAD
Will result in help output like:
Will result in help output like:
```
```
--port value Use a randomized port (default: random)
--port value Use a randomized port (default: random)
```
```
=======
>>>>>>> master
#### Precedence
#### Precedence
The precedence for flag value sources is as follows (highest to lowest):
The precedence for flag value sources is as follows (highest to lowest):