Commit Graph

253 Commits

Author SHA1 Message Date
Eyal Posener d752070d0f
Merge pull request #152 from sethvargo/sethvargo/deps
Switch to Go 1.20 errors package
2023-07-19 21:28:32 +03:00
Seth Vargo 200c018481
Switch to Go 1.20 errors package
This updates all subpackages and removes use of go-multierror in favor of the stdlib implementation.
2023-07-16 17:37:11 -04:00
Eyal Posener 3f9152130d
Merge pull request #140 from antichris/gocomplete-suppress-errors
gocomplete: suppress error output by default
2021-04-08 00:04:50 +03:00
goreadme 495a97af07 Update readme according to godoc 2021-04-06 16:39:51 +00:00
Eyal Posener feaa0dbdbf
Merge pull request #142 from posener/update-goreadme
Update goreadme
2021-04-06 19:39:17 +03:00
Eyal Posener 0c05a5f652 Update goreadme 2021-04-06 19:36:48 +03:00
Chris Nobody e203f94963 gocomplete: suppress error output by default
Prevent the Go command completion from jumbling up the shell prompt on
errors by setting the Writer of the standard lib default log.Logger to
ioutil.Discard unless the system environment variable `GOCOMP_VERBOSE`
has been explicitly set to "1" (e.g. for debugging purposes).

Fixes #139
2021-04-06 14:23:51 +03:00
Goreadme a2c2f61e14 Update readme according to Go doc 2021-04-06 03:46:54 +00:00
antichris 4a17a04514
complete: enable complete.Complete() output capturing (#138)
* complete: test capturing Complete() output

Implement an Example test to demonstrate capturing the output
of Complete(), which is crucial for integration tests.

* complete: do not hard-code the I/O streams at the package initialization

Instead of defining the input/output streams as unexported global vars
that only get their values assigned to once, at the very initialization
of the package, use the values that `os.Stdin` and `os.Stdout` have at
the particular moment on every `complete.Complete()` call.

Fix #137

* complete: capture and discard output in TestComplete

Restore earlier behavior using proper stream redirection this time.

* complete: output capturing example: define things in the package scope

Define the `stringLookup` func type and `promptEnv` func in the package
scope instead of the `ExampleComplete_outputCapturing` test.

* complete: rename the `stringLookup` func type to `getEnvFn`
2021-04-06 06:46:20 +03:00
Eyal Posener 002575c9d5
Merge pull request #136 from antichris/gocomplete-let-tests-fail
gocomplete: do not suppress test failures
2021-04-01 10:52:49 +03:00
Chris Nobody bf9b51caf4 gocomplete: do not suppress test failures
Ensure that the components of the `testing` package that rely on calling
`os.Exit` remain functional and any test failures are actually reported
back after the `monkey.Patch` in the `gocomplete.Example` test.

Fix #135
2021-04-01 10:46:54 +03:00
Eyal Posener 5d9f7f10f0 Fix failing go1.16 test
Fixes #132
2021-01-30 11:13:29 +02:00
Chris Walz 246bd25c47
fix crash when COMP_POINT is greater than COMP_LINE size (#128)
Some shells (inexplicably) occasionally have a COMP_POINT that is greater than the COMP_LINE size. When that happens completion should be based on length of the COMP_LINE to avoid an out of bounds error.

See the original hack fix here: https://github.com/chriswalz/bit/blob/master/cmd/bitcomplete.go on line 39
2020-11-08 18:56:26 +02:00
Eyal Posener 5c05e978ea
Merge pull request #123 from posener/autogen
Use autogen to generate code
2020-05-10 06:06:40 +03:00
Eyal Posener 1f0264a9ce Use autogen 2020-05-10 06:04:42 +03:00
Goreadme 0b15fb4d6e Update readme according to Go doc 2020-05-09 11:18:46 +00:00
Eyal Posener be08f3c422
Merge pull request #122 from posener/gen
Autogenerate compflag code
2020-05-09 14:18:11 +03:00
Eyal Posener 41182b029c Autogenerate compflag code 2020-05-09 14:17:09 +03:00
Goreadme e6d850dd6b Update readme according to Go doc 2020-04-10 07:36:11 +00:00
Eyal Posener 95737120ac Better godoc badge 2020-04-10 10:35:27 +03:00
Goreadme a40e86b7ee Update readme according to Go doc 2020-04-09 19:06:10 +00:00
Eyal Posener 99e65b0bc5 remove goreadme badge 2020-04-09 22:05:26 +03:00
Goreadme 206739e66f Update readme according to Go doc 2020-04-09 18:35:26 +00:00
Eyal Posener b22f70f90a
Merge pull request #121 from posener/actions
Add github actions
2020-04-09 21:34:49 +03:00
Eyal Posener f929a1cfb4 Add github actions 2020-04-09 21:31:51 +03:00
Eyal Posener bcff2ec278 Update readme 2020-04-04 12:47:08 +03:00
Eyal Posener 1b58b8b755 Add installation instructions
Related to #120
2020-04-04 12:44:12 +03:00
Eyal Posener bdd345f079 Fix (un)installation failure detection 2020-01-03 14:42:15 +02:00
Eyal Posener 3627b98439 Add missing functions to flagset 2019-11-27 22:24:33 +02:00
Eyal Posener e63b7a9037 Use command line name instead of external name 2019-11-27 22:01:40 +02:00
Eyal Posener 85f1fe4e1d Add duration flag 2019-11-27 21:33:55 +02:00
Eyal Posener 8a431c416e Fix doc error 2019-11-27 21:21:30 +02:00
Eyal Posener 3ac431b3cc Update to script 1.0.4 2019-11-24 08:28:56 +02:00
Eyal Posener e8cb4f352f fix script change 2019-11-24 00:42:07 +02:00
Eyal Posener 85542e6d46 update readme 2019-11-23 12:30:12 +02:00
Eyal Posener ddaf561db3 Install: use script library 2019-11-23 12:14:56 +02:00
Eyal Posener 027a352502 Add forgoten option tests 2019-11-23 11:39:35 +02:00
Eyal Posener a138e3dfcf Options: added docs 2019-11-22 15:03:53 +02:00
Eyal Posener a48bf3f856 Options: add tests 2019-11-22 15:01:47 +02:00
Eyal Posener 0f93c0740c Fix nil completor 2019-11-22 11:48:06 +02:00
Eyal Posener e8bbd08d57 Extract flag options to predict package 2019-11-22 11:43:37 +02:00
Eyal Posener cf002b9a50 Fix completion of help when completing flags 2019-11-21 00:16:33 +02:00
Eyal Posener b05895fa6c fix references to complete 2019-11-20 22:52:44 +02:00
Eyal Posener 7881076092
Merge pull request #109 from posener/goreadme
readme: Update according to go doc
2019-11-19 06:32:58 +02:00
goreadme 90f09d9f81 Update readme according to go doc 2019-11-19 04:32:42 +00:00
Eyal Posener 3794f4987c Actually adding the install package 2019-11-19 05:28:26 +02:00
Eyal Posener c3bfbddfe6 Move install package back to project root 2019-11-19 05:17:52 +02:00
Eyal Posener ca6cedb614
Merge pull request #106 from posener/goreadme
readme: Update according to go doc
2019-11-18 07:30:20 +02:00
goreadme 345db24139 Update readme according to go doc 2019-11-18 05:30:00 +00:00
Eyal Posener dd939deef3 fix doc 2019-11-18 07:29:45 +02:00