Commit Graph

2012 Commits

Author SHA1 Message Date
902f5abbc8
Use correct go version strings; other general CI updates 2022-04-21 15:18:35 -04:00
5c6ccfb097
Add missing "fmt" import in example 2022-04-20 14:45:04 -04:00
8c33a078d1
Use go env correctly 2022-04-20 14:41:26 -04:00
17aa508d22
Switch to gfmrun v1.3.0 2022-04-20 14:38:32 -04:00
12b9c9d420
Bump matrix of supported Go versions
to test on the latest release (^1.18) and drop testing/supporting ^1.15.
2022-04-19 16:32:23 -04:00
Ana Krivokapić
7b2e60968b
Small fixes to the v2 migration guide (#1340)
- Add missing items to TOC
- Remove items from TOC that don't exist in the document
- Reorder the items in TOC to match the document
2022-03-13 22:29:56 -04:00
Kir Kolyshkin
81cb783759
Fix strconv.ParseFloat usage (#1335)
The bitSize argument of ParseFloat should either be 32 or 64, not 10.

Found by staticcheck linter.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-02-16 21:29:15 -05:00
Kir Kolyshkin
3df9a3cd86
Don't call open("") (#1336)
strings.Split(s, sep) returns a slice of a single element containing s
if sep is not found in s. This is true even if s is empty.

As a result, every call to flagFromEnvOrFile results in an attempt to
open a file with empty name. This is seen from strace as

[pid 3287620] openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 3287620] openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
...

To fix, check if the string is empty before calling ReadFile.

This also fixes cases where filePath is non-empty but has extra commas.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-02-15 08:28:44 -05:00
Chenxiao Zhao
1bf639b391
remove useless variable declarations (#1330) 2022-02-04 02:21:50 -05:00
Daniel Mil
175bb8742c
Bump yaml.v2 version to 2.2.8 (#1326)
* Bump yamlv2 version

* Update max binary size to fix security vulnerability
2022-01-24 23:51:18 -05:00
Robert Liebowitz
5d61a2f46e
Bump Go version range in CI to 1.15-1.17 (#1323) 2022-01-24 08:59:04 +01:00
badcw
e855c4cd1d
fix: Nil pointer when getting context's flagSet(#1325) (#1327)
* fix: Nil pointer when getting context's flagSet in UsageError function(#1325)

* test: add unit test for nil flagset in Context
2022-01-16 19:22:57 -05:00
Anthony Fok
c2cf7ed6df
Bump github.com/cpuguy83/go-md2man/v2 to v2.0.1 (#1321)
Also fix test expectation for man contents: dash and underscore
are no longer escaped with backslash in go-md2man v2.0.1

See cpuguy83/go-md2man#74
2022-01-03 22:46:55 -05:00
Anthony Fok
a7d59840f4
Fix reversed Got/Expected in expectFileContent in docs_test.go (#1320) 2022-01-03 18:20:18 -05:00
Mritunjay Kumar Sharma
9afa0745ed
docs: Added some deprecated parts in migrating to v2 (#1319)
Co-authored-by: Robert Liebowitz <rliebz@gmail.com>
2021-12-30 07:17:48 -05:00
Tom Limoncelli
56bfa4be20
DOCS: Replace deprecated functions (#1317) 2021-12-30 06:43:21 -05:00
William Wilson
e8d8173889
Make test case compatible with Go 1.17 (#1299)
* Make test case compatible with Go 1.17

* tweak test case to bring coverage back up
2021-12-05 14:56:34 -05:00
John Olheiser
12b7dfd08c
Remove extraneous line from generated markdown (#1311)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-11-06 07:37:42 -04:00
JayCeeJr
1259f1efc9
Unnecessary words (#1304)
It is unclear what `as the default` means.

Much more concise to remove it.
2021-09-15 23:16:31 -04:00
Robert Liebowitz
67d7f9403d
Remove stalebot (#1300) 2021-09-09 05:31:46 -04:00
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
2021-07-06 20:33:01 -04:00
Link Dupont
6373f5bf65
feat(docs): Include Description and UsageText in docs output (#1287)
Include Description as part of the DESCRIPTION section, and put UsageText (if it is non-zero) into the Usage subsection.
2021-07-06 20:20:47 -04:00
Ashwani
b5d4a04c7f
Resolved a grammatical error (#1281) 2021-06-13 09:36:57 -04:00
Derek Smith
443c6a54a8
fix(UsageText): consistent indent for help UsageText output (#1279)
Signed-off-by: Derek Smith <dsmith@goodwaygroup.com>
2021-06-03 19:19:19 -04:00
Derek Smith
581b769cf3
feat(docs): add UsageText to docs output for markdown and man page generation (#1171)
* feat(docs): add UsageText to docs output for markdown and man page generation

* feat(docs): updated tests, DRYd up code, cleaned up string logic

* fix(lint): fixed go1.15 lint errors
2021-05-20 21:04:51 -04:00
Robert Liebowitz
e79ceb69ff
Merge pull request #1258 from dearchap/visible_interface
Fix(issue #631). Remove reflect calls for Hidden field
2021-04-24 13:10:52 -04:00
Robert Liebowitz
75602a4cfe
Merge pull request #1236 from vipally/ally_fix_default_val
bug fix #1235 : default value changes with parsed values on slice flags
2021-04-24 13:02:59 -04:00
Robert Liebowitz
ab52d6f3a9 Merge branch 'master' into ally_fix_default_val 2021-04-24 12:59:13 -04:00
Robert Liebowitz
b1a2d969f8
Merge pull request #1270 from rliebz/no-cov-token
Update GitHub action
2021-04-24 12:44:33 -04:00
Robert Liebowitz
80ba835e26 Update GitHub action
Bump go version to 1.16 and drop the codecov token, which is now
documented as not required for public repositories.
2021-04-24 12:33:29 -04:00
Robert Liebowitz
b7da09a687
Merge pull request #1255 from cpacifying/master
UsageText to be passed from Command to App in startApp
2021-04-24 12:02:48 -04:00
Robert Liebowitz
45eecb1d94
Merge pull request #1264 from dearchap/cleanup_context
Cleanup context.go
2021-04-24 12:02:16 -04:00
Robert Liebowitz
45952a7d1b
Merge pull request #1251 from davidsbond/timestamp-destination
Add Destination field to TimestampFlag
2021-04-08 19:27:29 -04:00
Naveen Gogineni
07e1fdf17d Cleanup context.go 2021-04-05 07:57:41 -04:00
Naveen Gogineni
df595c0d85 Fix(issue #631). Remove reflect calls for Hidden field 2021-03-25 20:45:30 -04:00
cpacifying
9433f216ff
UsageText to be passed from Command to App in startApp 2021-03-15 17:03:22 +02:00
David Bond
f2bed637fd
Add Destination field to TimestampFlag
Adds a `Destination` field for the `TimestampFlag` type that allows you to specify a pointer to
a `Timestamp` rather than having to grab the `Timestamp` from the `cli.Context` using the flag
name.
2021-03-07 03:36:56 +00:00
lynn (they)
13ded1e7c4
Merge pull request #1229 from urfave/lynncyrin-patch-1
Don't let stale bot close "help wanted" issues
2021-02-26 15:11:14 -08:00
AllyDale
c98b85d392 bug fix #1235 : default value changes with parsed values on slice flags 2021-02-05 15:16:50 +08:00
Robert Liebowitz
92d77844fe
Merge pull request #1232 from corburn/patch-2
remove repeated comment
2021-01-30 10:00:09 -05:00
Jason Travis
1985ecfdc0
remove repeated comment 2021-01-29 12:10:44 -07:00
Robert Liebowitz
5378891c91
Merge pull request #1210 from jcgregorio/fix-context-value
Fix Context.Value.
2021-01-28 23:22:21 -05:00
Robert Liebowitz
795a8adacb
Merge pull request #1208 from Madhur1997/master
Display `(accepts multiple inputs)` in the help description for Slice flags.
2021-01-28 23:20:42 -05:00
Robert Liebowitz
498b50b3e1
Merge pull request #1214 from anicoll/flag_lineage_fix
fix for parent context not setting child flags
2021-01-28 23:16:40 -05:00
lynn (they)
e1a74460d4
Merge pull request #1227 from nmi/fix_man_section
make the man page section selectable
2021-01-28 13:33:44 -08:00
lynn (they)
de20a55d0e
Merge pull request #1228 from zwass/patch-1
Link to godoc for v2
2021-01-28 13:33:34 -08:00
Joe Gregorio
d56c85cef5 Add test for the else path. 2021-01-28 14:35:55 -05:00
Joe Gregorio
b8debb6845 Fix Context.Value.
Before this change the added test would crash on a nil
pointer dereference because the original code would
only look in the local fileSet and not across all
the fileSets.
2021-01-28 14:35:55 -05:00
Madhur batra
e73d6e133d Merge branch 'master' of https://github.com/urfave/cli 2021-01-28 10:47:45 +05:30
Nobuhiro MIKI
ed2ee4bc4a make the man page section selectable
Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2021-01-28 09:39:26 +09:00