Naveen Gogineni
e302525d58
Fix:(issue_1263) FlagNames should return names set via env as well
2 years ago
Naveen Gogineni
e8b5e4a1d0
Fix windows compile
2 years ago
Naveen Gogineni
6b738dc4e5
Use withEnvHint instead of custom func
2 years ago
Naveen Gogineni
e320fd80a2
Fix windows env error
2 years ago
Naveen Gogineni
729a7c41ce
Fix:(issue_1206) Default value shouldnt depend on env variable or value set from cmdline
2 years ago
Jakub Nowakowski
c472192257
Add unit test for GenericFlag Destination parsing
...
The test checks if Destination provided in GenericFlag is being set as
expected.
2 years ago
Felix Lange
72cbb3db6a
Call FlagStringer in String() method of slice flags
...
The default help template relies on the String() method of Flag
to render the flag. For most flag types, String() indirects through
FlagStringer, so that is the best place to customize flag rendering.
FlagStringer was not called for slice flags because their help output
differs from other flags in two ways: there can be multiple default
values, and the flag name is shown two times to indicate that the flag
can be specified multiple times.
To make multiple values work in the FlagStringer, I simply changed
GetValue() to return all values.
Showing the flag more than once is achieved through a new interface,
DocGenerationSliceFlag, which the FlagStringer uses to decide whether
the flag is a slice flag type.
2 years ago
Naveen Gogineni
d0fff2e8cc
Add additional test to fix codecov
2 years ago
Naveen Gogineni
b087856c64
Add additional test to fix codecov
2 years ago
Naveen Gogineni
f6b4ee0e78
Merge from main
2 years ago
Naveen Gogineni
0c7dcf7c2b
Fix formatting
2 years ago
Naveen Gogineni
ec257a8705
Fix tests per latest main
2 years ago
Naveen Gogineni
f8b9a7cc2e
Merge changes from main
2 years ago
Naveen Gogineni
15fd35e7b4
Add parametrize tests
2 years ago
Naveen Gogineni
7941e8ccf6
Add context.Count
2 years ago
Naveen Gogineni
b4e0ec3b8a
Add count option for bool flags
2 years ago
dearchap
f451dead12
Fix:(issue_1272) Generic flag not set from env ( #1458 )
2 years ago
ccremer
bd2ae121ab
Add configurable Base to int, uint and uint64 flags
...
This allows users to configure the basis for integer parsing.
2 years ago
Naveen Gogineni
b80ff3d32f
issue_62: Make slice options more posix like
2 years ago
Balazs Nagy
1335a7022a
accept timezone for timestamps
2 years ago
Joseph Cumines
e77dd7bb68
Add SliceFlag wrapper and fix bugs in existing implementations
...
The SliceFlag implementation and associated aliases (MultiStringFlag, etc)
extend the existing slice implementations (StringSliceFlag, etc) to support
actual slices as the flag value and destination.
This change also fixes various bugs in the existing implementation. Notably,
the StringSliceFlag.Apply implementation would modify the input (default)
Value, if an env var was set, and no destination was provided. The bugs fixed
in the other three implementations were all already fixed in either
StringSliceFlag, or in one case (ignoring empty env var) in Float64SliceFlag.
2 years ago
Dan Buch
04f5ff0315
Merge branch 'main' into mostynb-report_source_of_parse_errors
2 years ago
Dan Buch
e7db6af492
Merge remote-tracking branch 'origin/main' into mostynb-report_source_of_parse_errors
2 years ago
Dan Buch
8cc43782ed
Merge branch 'main' into feature/1316-simplified_flag_value_access
2 years ago
Dan Buch
6538e95d65
Merge branch 'ally_fix_multi_val' of ssh://github.com/vipally/cli into vipally-ally_fix_multi_val
2 years ago
Kacper Bąk
4c7b46cb24
fix: clean code
2 years ago
Tilo Prütz
835bd32714
rename flags’ ValueFromContext() to Get()
2 years ago
Dan Buch
c864c2425e
Merge pull request #1260 from dearchap/issue_1254
...
Add test case for short option handling
2 years ago
Naveen Gogineni
8c5f1fb359
Changes from code review
2 years ago
Naveen Gogineni
156d47e696
Fix: (issue#1254) short options handling needs to proceed from last terminated error
2 years ago
Tilo Prütz
ca7f26ecb0
Uint64Flag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
1f621059d3
UintFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
889c7b5d7a
TimestampFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
6b336c478f
StringSliceFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
ce4d9279c4
StringFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
660184dd92
PathFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
6d7f859008
IntSliceFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
dcc47855b8
Int64SliceFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
18b44dfb29
Int64Flag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
bf18c00347
IntFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
8bd5fb2390
GenericFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
2f92fc644c
Float64SliceFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
5047beb001
Float64Flag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
9eae255aac
DurationFlag.ValueFromContext() as convenient accessor
2 years ago
Tilo Prütz
baf8ae98de
BoolFlag.ValueFromContext() as convenient accessor
2 years ago
Dan Buch
9fd3cc92ad
Add tests around flag stringifying for all modified types
2 years ago
Dan Buch
d83bb8d85e
Merge branch 'main' into remove_reflect
2 years ago
Dan Buch
826b3edd3f
Merge branch 'report_source_of_parse_errors' of ssh://github.com/mostynb/cli into mostynb-report_source_of_parse_errors
2 years ago
Ally Dale
58d113dd73
fix #1239 : slice flag value don't append to default values from ENV or file ( #1240 )
...
* fix #1239 : slice flag value don't append to default values from ENV or file
* remove test code
3 years ago
Naveen Gogineni
7cd7ff7dd5
Remove reflect from flag_test
3 years ago