Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default shown in usage is incorrect when the option is supplied #1181

Closed
4 of 7 tasks
ericmillin opened this issue Aug 27, 2020 · 7 comments
Closed
4 of 7 tasks

Default shown in usage is incorrect when the option is supplied #1181

ericmillin opened this issue Aug 27, 2020 · 7 comments
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Milestone

Comments

@ericmillin
Copy link

my urfave/cli version is

2.1.1

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this problem? Here's the Github guide 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.

Describe the bug

If a command fails due to invalid usage, values assigned to valid options are used to populate the defaults.

To reproduce

  1. Create the command foo
  2. Add the flag fizz and mark it as required.
  3. Add the IntFlag bang with the default value of 1.
  4. Run the command foo --bang 2

Observed behavior

The default in the usage text will show (default: 2)

Expected behavior

The default in the usage text will show (default: 1)

@ericmillin ericmillin added area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this labels Aug 27, 2020
@asahasrabuddhe
Copy link
Member

1181

Unable to reproduce issue. This was the example I tried.

@stale
Copy link

stale bot commented Jan 30, 2021

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale stale due to the age of it's last update label Jan 30, 2021
@coilysiren
Copy link
Member

This looks like a duplicate of #1206, but I would have to dive into the code to say that with confidence.

@stale
Copy link

stale bot commented Feb 10, 2021

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

@stale stale bot removed the status/stale stale due to the age of it's last update label Feb 10, 2021
@stale
Copy link

stale bot commented Jun 2, 2021

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale stale due to the age of it's last update label Jun 2, 2021
@stale
Copy link

stale bot commented Jul 4, 2021

Closing this as it has become stale.

@stale stale bot closed this as completed Jul 4, 2021
@meatballhat meatballhat reopened this Apr 22, 2022
@meatballhat meatballhat removed the status/stale stale due to the age of it's last update label Apr 22, 2022
@meatballhat meatballhat changed the title v2 bug: Default shown in usage is incorrect when the option is supplied Default shown in usage is incorrect when the option is supplied Apr 23, 2022
@dearchap
Copy link
Contributor

Unable to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

5 participants