2662 Commits

Author SHA1 Message Date
meatballhat 11915a875d Build and run urfave-cli-genflags via its Makefile
so that `go.mod` files don't get all confused
2022-10-09 11:25:02 -04:00
Naveen Gogineni fcb0bce797 Fix failed test 2022-10-09 10:09:36 -04:00
Naveen Gogineni 924ebdaab2 Fix:(issue_1500). Fix slice flag value duplication issue 2022-10-09 10:09:36 -04:00
Naveen Gogineni ea2893084b Remove extra 3 spaces in last line 2022-10-09 09:59:46 -04:00
Naveen Gogineni 9a9461928a Add test coverage for Command.VisibleCommands() 2022-10-09 09:59:46 -04:00
dearchap a4b7759ad1 Update template.go
Co-authored-by: Anatoli Babenia <anatoli@rainforce.org>
2022-10-09 09:59:35 -04:00
Naveen Gogineni dccd762cbb Componentize template 2022-10-09 09:59:35 -04:00
Naveen Gogineni c86805de7c Add test case 2022-10-09 09:59:35 -04:00
Naveen Gogineni ae8c5118f2 Fix command help subcommand 2022-10-09 09:59:35 -04:00
Naveen Gogineni 13860a7c4d Fix:(issue_1505) Fix flag alignment in help 2022-10-09 09:59:35 -04:00
Jakub Nowakowski b82e628617 Add unit test for GenericFlag Destination parsing
The test checks if Destination provided in GenericFlag is being set as
expected.
2022-10-09 09:57:25 -04:00
Jakub Nowakowski 01bdec784f Set destination in GenericFlag apply function
The function was missing destination configuration.
2022-10-09 09:57:25 -04:00
meatballhat c5057d195e Only run generate on go 1.19 2022-10-09 09:51:19 -04:00
meatballhat 65c98c86ad Ensure "generate" step runs in CI prior to diff check 2022-10-09 09:51:19 -04:00
Felix Lange 82ea9f70c0 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.
2022-10-09 09:50:12 -04:00
Anatoli Babenia 4959a9fa9b Refactor wrap() and add test for empty line 2022-10-09 09:33:19 -04:00
Anatoli Babenia e14dca7a18 Run go fmt 2022-10-09 09:33:19 -04:00
Anatoli Babenia 05fb755b6a wrap: Simplify loop logic
Suggested by @julian7
2022-10-09 09:33:19 -04:00
Anatoli Babenia d3bb381a0b Fix test for removed trailing whitespace 2022-10-09 09:33:19 -04:00
Anatoli Babenia a6f5ca69f4 wrap: Avoid trailing whitespace for empty lines 2022-10-09 09:33:19 -04:00
Naveen Gogineni 662deaa57b Run v2approve 2022-10-08 10:09:54 -05:00
Naveen Gogineni cf41aab451 Revert changes 2022-10-08 09:57:52 -05:00
Naveen Gogineni 1a31a6e2fc Revert "Remove all flag interfaces"
This reverts commit 268cb973f8.
2022-10-08 09:47:46 -05:00
Naveen Gogineni 81f9145708 Refactor code 2022-10-07 11:17:09 -05:00
Naveen Gogineni 8227be1fe9 Add tests for command.VisibleFlagCategory 2022-10-07 11:06:34 -05:00
Naveen Gogineni e62a087117 Run make v2approve 2022-10-06 20:55:28 -05:00
Naveen Gogineni 02613e50be Fix tests 2022-10-06 20:53:05 -05:00
范广宇 1ada1a1c06 fix: stop automatic sorting for --help 2022-10-06 17:21:46 -05:00
dearchap f64acc4404 Merge pull request #1502 from dearchap/issue_1500
Fix:(issue_1500). Fix slice flag value duplication issue
2022-10-06 11:20:29 -04:00
dearchap fb23ff4aa2 Merge branch 'main' into issue_1500 2022-10-06 11:07:28 -04:00
dearchap 2a4809f3af Merge pull request #1506 from dearchap/issue_1505
Fix:(issue_1505) Fix flag alignment in help
2022-10-06 11:06:25 -04:00
dearchap 86809cef4b Merge branch 'main' into issue_1505 2022-10-06 11:06:10 -04:00
dearchap 9166808eb5 Merge pull request #1510 from urfave/v3-porting
Porting to v3
2022-10-05 22:22:08 -04:00
dearchap 8f469abc00 Merge pull request #1442 from nkuba/generit-flag-destination-pointer
Configure GenericFlag's Destination type as struct not pointer
2022-10-05 22:21:27 -04:00
Naveen Gogineni 67f293a1e5 Revert main_test 2022-10-05 22:18:45 -04:00
Naveen Gogineni a9c758e55f Fix compile 2022-10-05 22:15:43 -04:00
Naveen Gogineni d724a63144 After rebase 2022-10-05 22:10:22 -04:00
Jakub Nowakowski c472192257 Add unit test for GenericFlag Destination parsing
The test checks if Destination provided in GenericFlag is being set as
expected.
2022-10-05 22:04:46 -04:00
Jakub Nowakowski a2541e0fe4 Set destination in GenericFlag apply function
The function was missing destination configuration.
2022-10-05 22:04:46 -04:00
Jakub Nowakowski 891ffb017b Add DestinationPointer for flags generator
In this commit I added a DestinationPointer variable that should be set
if the `Destination` should be configured as a pointer for a specific
flag type. It is expected that Generic type which is an interface will
not be a pointer but a struct. Before this change the code compilation
was failing with `type *Generic is pointer to interface, not interface`.

See https://github.com/urfave/cli/issues/1441
2022-10-05 22:04:46 -04:00
dearchap b68db8d010 Merge pull request #1504 from urfave/generate-in-ci
Ensure "generate" step runs in CI prior to diff check
2022-10-05 20:33:29 -04:00
Naveen Gogineni 194ed2bb9b Remove extra 3 spaces in last line 2022-10-05 20:26:45 -04:00
Naveen Gogineni d5a1252ef3 Add test coverage for Command.VisibleCommands() 2022-10-05 20:26:45 -04:00
Naveen Gogineni 05db729d66 Do make v2approve 2022-10-05 20:26:45 -04:00
dearchap 0b2aca7ccc Update template.go
Co-authored-by: Anatoli Babenia <anatoli@rainforce.org>
2022-10-05 20:26:45 -04:00
Naveen Gogineni 8f6acfe15d Componentize template 2022-10-05 20:26:45 -04:00
Naveen Gogineni 6504da449b Add test case 2022-10-05 20:26:45 -04:00
Naveen Gogineni 2da6e68555 Fix command help subcommand 2022-10-05 20:26:45 -04:00
Naveen Gogineni 2ee2548476 Fix:(issue_1505) Fix flag alignment in help 2022-10-05 20:26:45 -04:00
dearchap 3c5c3a4aa9 Merge pull request #1508 from fjl/slice-flag-stringer
Call FlagStringer in String() method of slice flags
2022-10-05 20:25:01 -04:00