cli icon indicating copy to clipboard operation
cli copied to clipboard

Conflicting documentation in manual for flag precedence

Open xiegeo opened this issue 6 years ago • 3 comments

my urfave/cli version is

2.1.1

Checklist

  • [x] Are you running the latest v2 release? The list of releases is here.
  • [x] Did you check the manual for your release? The v2 manual is here
  • [x] Did you perform a search about this problem? Here's the Github guide about searching.

Describe the bug

Under https://github.com/urfave/cli/blob/master/docs/v2/manual.md#values-from-files

Note that default values set from file (e.g. FilePath) take precedence over default values set from the environment (e.g. EnvVar).

But at https://github.com/urfave/cli/blob/master/docs/v2/manual.md#precedence

  1. Environment variable (if specified)
  2. Configuration file (if specified)

Expected behavior

Consistency withing documentation and between documentation and code.

xiegeo avatar Jan 01 '20 03:01 xiegeo

I don't know which precedence is correct off-hand, and would appreciate if someone could research that and update the manual 👍 I marked this with help wanted for anyone to pick up.

coilysiren avatar Jan 04 '20 08:01 coilysiren

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[bot] avatar Apr 03 '20 08:04 stale[bot]

Closing this as it has become stale.

stale[bot] avatar May 03 '20 09:05 stale[bot]

Documentation has been corrected to reflect actual behavior

dearchap avatar Oct 17 '22 10:10 dearchap

Documentation has been corrected to reflect actual behavior

~Could you point me to PR or Commit?~

Actually not:

Note that default values set from file (e.g. FilePath) take precedence over default values set from the environment (e.g. EnvVar)

The precedence for flag value sources is as follows (highest to lowest): Environment variable (if specified) Configuration file (if specified)

~Should be reopened.~

#1866

zc-devs avatar Feb 17 '24 09:02 zc-devs