diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index bca4fea10d..b9680757c2 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,12 +1,10 @@ --- name: ask a question -about: ask us question - assume stackoverflow's guidelines apply here -title: 'q: ( your question title goes here )' +about: ask a question - assume stackoverflow's guidelines apply here +title: your question title goes here labels: 'kind/question, status/triage, area/v2' assignees: '' --- -## my question is... - -_**( Put the question text here )**_ +my question is... diff --git a/.github/ISSUE_TEMPLATE/v1-bug-report.md b/.github/ISSUE_TEMPLATE/v1-bug-report.md index aabfe820a6..1205d388be 100644 --- a/.github/ISSUE_TEMPLATE/v1-bug-report.md +++ b/.github/ISSUE_TEMPLATE/v1-bug-report.md @@ -1,28 +1,32 @@ --- name: v1 bug report about: Create a report to help us fix v1 bugs -title: 'v1 bug: ( your bug title goes here )' +title: 'your bug title goes here' labels: 'kind/bug, status/triage, area/v1' assignees: '' --- -## my urfave/cli version is +## My urfave/cli version is _**( Put the version of urfave/cli that you are using here )**_ ## Checklist -* [ ] Are you running the latest v1 release? The list of releases is [here](https://github.com/urfave/cli/releases). -* [ ] Did you check the manual for your release? The v1 manual is [here](https://github.com/urfave/cli/blob/master/docs/v1/manual.md) -* [ ] Did you perform a search about this problem? Here's the [Github guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching. +- [ ] Are you running the latest v1 release? The list of releases is [here](https://github.com/urfave/cli/releases). +- [ ] Did you check the manual for your release? The v1 manual is [here](https://github.com/urfave/cli/blob/main/docs/v1/manual.md). +- [ ] Did you perform a search about this problem? Here's the [Github guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching. ## Dependency Management -- [ ] My project is using go modules. -- [ ] My project is using vendoring. -- [ ] My project is automatically downloading the latest version. -- [ ] I am unsure of what my dependency management setup is. + + +- My project is using go modules. +- My project is using vendoring. +- My project is automatically downloading the latest version. +- I am unsure of what my dependency management setup is. ## Describe the bug @@ -34,23 +38,30 @@ Describe the steps or code required to reproduce the behavior ## Observed behavior -What did you see happen immediately after the reproduction steps above? +What did you see happen immediately after the reproduction steps +above? ## Expected behavior -What would you have expected to happen immediately after the reproduction steps above? +What would you have expected to happen immediately after the +reproduction steps above? ## Additional context Add any other context about the problem here. -If the issue relates to a specific open source Github repo, please link that repo here. +If the issue relates to a specific open source Github repo, please +link that repo here. -If you can reproduce this issue with a public CI system, please link a failing build here. +If you can reproduce this issue with a public CI system, please +link a failing build here. ## Want to fix this yourself? -We'd love to have more contributors on this project! If the fix for this bug is easily explained and very small, free free to create a pull request for it. You'll want to base the PR off the `v1` branch, all `v1` bug fix releases will be made from that branch. +We'd love to have more contributors on this project! If the fix for +this bug is easily explained and very small, free free to create a +pull request for it. You'll want to base the PR off the `v1` +branch, all `v1` bug fix releases will be made from that branch. ## Run `go version` and paste its output here diff --git a/.github/ISSUE_TEMPLATE/v2-bug-report.md b/.github/ISSUE_TEMPLATE/v2-bug-report.md index 9944769b3e..5c120e14f6 100644 --- a/.github/ISSUE_TEMPLATE/v2-bug-report.md +++ b/.github/ISSUE_TEMPLATE/v2-bug-report.md @@ -1,28 +1,32 @@ --- name: v2 bug report about: Create a report to help us fix v2 bugs -title: 'v2 bug: ( your bug title goes here )' +title: 'your bug title goes here' labels: 'kind/bug, area/v2, status/triage' assignees: '' --- -## my urfave/cli version is +## My urfave/cli version is _**( Put the version of urfave/cli that you are using here )**_ ## Checklist -* [ ] Are you running the latest v2 release? The list of releases is [here](https://github.com/urfave/cli/releases). -* [ ] Did you check the manual for your release? The v2 manual is [here](https://github.com/urfave/cli/blob/master/docs/v2/manual.md) -* [ ] Did you perform a search about this problem? Here's the [Github guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching. +- [ ] Are you running the latest v2 release? The list of releases is [here](https://github.com/urfave/cli/releases). +- [ ] Did you check the manual for your release? The v2 manual is [here](https://github.com/urfave/cli/blob/main/docs/v2/manual.md) +- [ ] Did you perform a search about this problem? Here's the [Github guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching. ## Dependency Management -- [ ] My project is using go modules. -- [ ] My project is using vendoring. -- [ ] My project is automatically downloading the latest version. -- [ ] I am unsure of what my dependency management setup is. + + +- My project is using go modules. +- My project is using vendoring. +- My project is automatically downloading the latest version. +- I am unsure of what my dependency management setup is. ## Describe the bug @@ -34,23 +38,30 @@ Describe the steps or code required to reproduce the behavior ## Observed behavior -What did you see happen immediately after the reproduction steps above? +What did you see happen immediately after the reproduction steps +above? ## Expected behavior -What would you have expected to happen immediately after the reproduction steps above? +What would you have expected to happen immediately after the +reproduction steps above? ## Additional context Add any other context about the problem here. -If the issue relates to a specific open source Github repo, please link that repo here. +If the issue relates to a specific open source Github repo, please +link that repo here. -If you can reproduce this issue with a public CI system, please link a failing build here. +If you can reproduce this issue with a public CI system, please +link a failing build here. ## Want to fix this yourself? -We'd love to have more contributors on this project! If the fix for this bug is easily explained and very small, free free to create a pull request for it. +We'd love to have more contributors on this project! If the fix for +this bug is easily explained and very small, free free to create a +pull request for it. + ## Run `go version` and paste its output here ``` diff --git a/.github/ISSUE_TEMPLATE/v2-feature-request.md b/.github/ISSUE_TEMPLATE/v2-feature-request.md index bc527b1c6e..2b1e727584 100644 --- a/.github/ISSUE_TEMPLATE/v2-feature-request.md +++ b/.github/ISSUE_TEMPLATE/v2-feature-request.md @@ -1,7 +1,7 @@ --- name: v2 feature request about: Suggest an improvement for v2 -title: 'v2 feature: ( your feature title goes here )' +title: 'your feature title goes here' labels: 'type/feature, area/v2, status/triage' assignees: '' @@ -10,16 +10,19 @@ assignees: '' ## Checklist * [ ] Are you running the latest v2 release? The list of releases is [here](https://github.com/urfave/cli/releases). -* [ ] Did you check the manual for your release? The v2 manual is [here](https://github.com/urfave/cli/blob/master/docs/v2/manual.md) +* [ ] Did you check the manual for your release? The v2 manual is [here](https://github.com/urfave/cli/blob/main/docs/v2/manual.md). * [ ] Did you perform a search about this feature? Here's the [Github guide](https://help.github.com/en/github/managing-your-work-on-github/using-search-to-filter-issues-and-pull-requests) about searching. ## What problem does this solve? A clear and concise description of what problem this feature would solve. For example: -- needing to type out the full flag name takes a long time, so I would like to suggest adding auto-complete -- I use (osx, windows, linux) and would like support for (some existing feature) to be extended to my platform -- the terminal output for a particular error case is confusing, and I think it could be improved +- needing to type out the full flag name takes a long time, so I + would like to suggest adding auto-complete +- I use (osx, windows, linux) and would like support for (some + existing feature) to be extended to my platform +- the terminal output for a particular error case is confusing, and + I think it could be improved ## Solution description @@ -27,4 +30,5 @@ A detailed description of what you want to happen. ## Describe alternatives you've considered -A clear and concise description of any alternative solutions or features you've considered. +A clear and concise description of any alternative solutions or +features you've considered. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4e76725765..47348f85ca 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,10 +8,14 @@ _(REQUIRED)_ -- [ ] bug -- [ ] cleanup -- [ ] documentation -- [ ] feature + + +- bug +- cleanup +- documentation +- feature ## What this PR does / why we need it: @@ -28,6 +32,7 @@ _(REQUIRED)_ ## Which issue(s) this PR fixes: _(REQUIRED)_ + @@ -53,7 +56,7 @@ Check each file for this and make the change. Shell command to find them all: `fgrep -rl github.com/urfave/cli *` -# Flag aliases are done differently. +# Flag aliases are done differently Change `Name: "foo, f"` to `Name: "foo", Aliases: []string{"f"}` @@ -181,6 +184,52 @@ Compiler messages you might see: cannot use c (type *cli.Command) as type cli.Command in append ``` +# GlobalString, GlobalBool and its likes are deprecated + +Use simply `String` instead of `GlobalString`, `Bool` instead of `GlobalBool` + +# BoolTFlag and BoolT are deprecated + +BoolTFlag was a Bool Flag with its default value set to true and BoolT was used to find any BoolTFlag used locally, so both are deprecated. + +* OLD: + +```go +cli.BoolTFlag{ + Name: FlagName, + Usage: FlagUsage, + EnvVar: "FLAG_ENV_VAR", +} +``` +* NEW: +```go +cli.BoolFlag{ + Name: FlagName, + Value: true, + Usage: FlagUsage, + EnvVar: "FLAG_ENV_VAR", +} +``` + + +# &cli.StringSlice{""} replaced with cli.NewStringSlice("") + +Example: + +* OLD: + +```go +Value: &cli.StringSlice{""}, +``` +* NEW: +```go +Value: cli.NewStringSlice(""), +} +``` +# Replace deprecated functions + +`cli.NewExitError()` is deprecated. Use `cli.Exit()` instead. ([Staticcheck](https://staticcheck.io/) detects this automatically and recommends replacement code.) + # Everything else Compile the code and work through any errors. Most should diff --git a/docs/v2/manual.md b/docs/v2/manual.md index af09010b9a..b480dd685f 100644 --- a/docs/v2/manual.md +++ b/docs/v2/manual.md @@ -514,7 +514,7 @@ func main() { ``` If `EnvVars` contains more than one string, the first environment variable that -resolves is used as the default. +resolves is used.