Commit Graph

2645 Commits

Author SHA1 Message Date
Naveen Gogineni 6b738dc4e5 Use withEnvHint instead of custom func 2022-10-14 17:46:03 -04:00
Naveen Gogineni e320fd80a2 Fix windows env error 2022-10-14 17:46:03 -04:00
Naveen Gogineni 729a7c41ce Fix:(issue_1206) Default value shouldnt depend on env variable or value set from cmdline 2022-10-14 17:46:03 -04:00
dearchap 39b1245772 Merge pull request #1533 from dearchap/fix_docs
Cleanup: Fix app.go formatting
2022-10-14 17:43:57 -04:00
Naveen Gogineni bb8ddda480 Cleanup: Fix app.go formatting 2022-10-14 17:26:56 -04:00
dearchap adcd0c970a Merge pull request #1532 from dearchap/fix_docs
Docs: Fix docs from merged PR1498
2022-10-14 17:20:26 -04:00
Naveen Gogineni 7a5db9223d Docs: Fix docs from merged PR1498 2022-10-14 17:13:13 -04:00
dearchap 0d0d329866 Merge pull request #1498 from dearchap/optimize_command_run 2022-10-14 02:46:25 -04:00
dearchap 33d08c39be Update app.go
Co-authored-by: Dan Buch <dan@meatballhat.com>
2022-10-14 02:46:00 -04:00
meatballhat 85ff0c550a Un-regress from v3 porting losses 2022-10-13 08:15:14 -04:00
meatballhat 75aabac594 Use existing goimports installation if available 2022-10-13 07:47:17 -04:00
meatballhat b45820714d Build and run urfave-cli-genflags via its Makefile
so that `go.mod` files don't get all confused
2022-10-13 07:47:17 -04:00
meatballhat 89e331ff27 Merge pull request #1526 from urfave/genflags-mod
Build and run `urfave-cli-genflags` via its `Makefile`
2022-10-13 07:44:55 -04:00
Naveen Gogineni 5100c9d4e9 Update docs 2022-10-11 19:40:59 -04:00
Naveen Gogineni 00afca42c8 Add RunAsSubcommand to keep API unchanged 2022-10-11 16:35:54 -04:00
Naveen Gogineni 4a109bc0ce Fix tests 2022-10-11 16:28:12 -04:00
Naveen Gogineni a9d6b0d821 Changes from code review 2022-10-11 09:18:57 -04:00
Naveen Gogineni 59095aa762 make cmd.Run use varargs 2022-10-10 18:32:56 -04:00
meatballhat 6404f1d1b4 Backfill drop of generated GetDefaultText method 2022-10-10 10:57:06 -04:00
meatballhat e9f2ca42db Use existing goimports installation if available 2022-10-10 08:48:50 -04:00
meatballhat 6ec1f4bb44 Merge branch 'main' into genflags-mod 2022-10-09 19:23:54 -04:00
Naveen Gogineni adcce134f3 Rebase origin 2022-10-09 16:51:42 -05:00
Naveen Gogineni 2047c6630c Cleanup 2022-10-09 16:49:30 -05:00
Naveen Gogineni 00ef229486 Fix docs 2022-10-09 16:49:30 -05:00
Naveen Gogineni 2576c0ce4e Fix docs 2022-10-09 16:49:30 -05:00
Naveen Gogineni fa21c74096 Fix altsrc tests 2022-10-09 16:49:30 -05:00
Naveen Gogineni bc9ae33465 Merge latest and fix tests 2022-10-09 16:49:30 -05:00
Naveen Gogineni d5947d7814 Initial cut 2022-10-09 16:49:30 -05:00
dearchap f37b9d9b60 Merge pull request #1430 from FGYFFFF/fix/stop_auto_sort_for_help
fix: stop automatic sorting for --help
2022-10-09 16:39:58 -05:00
Naveen Gogineni bffaf3b78c Update flags.md for docs change 2022-10-09 16:07:55 -05:00
meatballhat 96216756c2 Remove duplicate DocGenerationFlag interface
introduced via merge
2022-10-09 12:41:30 -04:00
meatballhat 64facdbe2f Merge remote-tracking branch 'origin/v3-dev-main' into v3-porting 2022-10-09 12:40:44 -04:00
dearchap 83ea416eb3 Merge pull request #1517 from dearchap/revert_remove_all_flag_interfaces 2022-10-09 11:37:29 -05:00
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