Go to file
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
.github Point docs tests at v3 2022-10-03 10:12:37 -04:00
altsrc Add unit tests 2022-10-03 08:15:23 -04:00
autocomplete Refinements to removal of zsh hack 2022-05-22 09:07:03 -04:00
cmd/urfave-cli-genflags Rebase main, update flag-spec.yaml to add Action field 2022-10-03 09:34:46 -04:00
docs Move more functionality into internal/build/build.go 2022-10-03 08:14:37 -04:00
internal Accept the MKDOCS_REMOTE_GITHUB_TOKEN var as intended 2022-10-03 08:15:01 -04:00
testdata Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
.flake8 Allow slightly longer lines in Python scripts 2017-02-14 21:17:32 -08:00
.gitignore Shift supported go versions 2022-10-02 10:30:39 -04:00
app_test.go Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
app.go Remove un-needed func 2022-10-03 09:46:31 -04:00
args.go add is set method to flag interface - refer #294 2019-09-15 18:46:52 +05:30
category.go Remove all flag interfaces 2022-09-04 22:51:05 -04:00
cli.go Use goimports as formatting standard 2022-10-02 10:26:48 -04:00
CODE_OF_CONDUCT.md Use google group email addresses 2022-05-07 09:30:42 -04:00
command_test.go Unshadow context package 2022-04-23 22:07:16 -04:00
command.go Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
context_test.go fix: Context.Set no such flag 2022-10-03 08:15:41 -04:00
context.go fix: Context.Set no such flag 2022-10-03 08:15:41 -04:00
docs_test.go Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
docs.go Remove all flag interfaces 2022-09-04 22:51:05 -04:00
errors_test.go Update docs and tests around cli.Exit 2020-03-24 20:32:39 -04:00
errors.go Cleanup context.go 2021-04-05 07:57:41 -04:00
fish_test.go Move some test helpers from docs_test to fish_test 2022-04-25 10:04:40 -07:00
fish.go Remove all flag interfaces 2022-09-04 22:51:05 -04:00
flag_bool.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_duration.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_float64_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_float64.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_generic.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_int64_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_int64.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_int_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_int.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_path.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_string_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_string.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_test.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_timestamp.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_uint64_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_uint64.go feat: flag action 2022-10-03 08:28:44 -04:00
flag_uint_slice.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
flag_uint.go feat: flag action 2022-10-03 08:28:44 -04:00
flag-spec.yaml Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
flag.go Call FlagStringer in String() method of slice flags 2022-10-09 09:50:12 -04:00
funcs.go Rename App.UnknownFlagHandler to App.InvalidFlagAccessHandler 2022-10-02 11:02:31 -04:00
go.mod Rebase main 2022-10-02 21:13:44 -04:00
go.sum Rebase main 2022-10-02 21:13:44 -04:00
godoc-current.txt Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
help_test.go Refactor wrap() and add test for empty line 2022-10-09 09:33:19 -04:00
help.go Refactor wrap() and add test for empty line 2022-10-09 09:33:19 -04:00
helpers_test.go Add Destination field to TimestampFlag 2021-03-07 03:36:56 +00:00
LICENSE Cleaning up some release-related metadata 2022-04-24 08:10:33 -04:00
Makefile Remove nonexistent phony targets 2022-10-03 09:46:48 -04:00
mkdocs-requirements.txt Attempt to work around materialx yaml loader boom 2022-05-18 22:58:46 -04:00
mkdocs.yml add tags plugin 2022-10-02 10:36:36 -04:00
parse.go Add suggestions support 2020-03-03 13:06:34 +01:00
README.md Bump declared module and internal usage to /v3/ 2022-09-12 07:51:51 -04:00
sliceflag_test.go Target minimum go 1.18 in v3-dev-main 2022-07-16 12:10:51 -04:00
sliceflag.go Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
sort_test.go Merge master @1.22.1 with v2 2019-09-13 05:17:24 +05:30
sort.go Merge master @1.22.1 with v2 2019-09-13 05:17:24 +05:30
suggestions_test.go Fix HideHelp 2022-10-01 19:17:49 -04:00
suggestions.go Remove GPL2 dependency introduced in v2.7.0 2022-05-24 15:27:35 +09:00
template.go Fix:(issue_557) Make help output consistent between different invocations 2022-10-03 09:46:18 -04:00
zz_generated.flags_test.go Post-porting fixes for v3 2022-10-03 10:06:01 -04:00
zz_generated.flags.go Rebase main, update flag-spec.yaml to add Action field 2022-10-03 09:34:46 -04:00

cli

GoDoc codebeat Go Report Card codecov

cli is a simple, fast, and fun package for building command line apps in Go. The goal is to enable developers to write fast and distributable command line applications in an expressive way.

Documentation

More documentation is available in ./docs or the hosted documentation site at https://cli.urfave.org.

License

See LICENSE