summaryrefslogtreecommitdiff
path: root/complete.go
AgeCommit message (Collapse)Author
2021-04-06complete: enable complete.Complete() output capturing (#138)antichris
* 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`
2020-11-08fix crash when COMP_POINT is greater than COMP_LINE size (#128)Chris Walz
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
2019-11-21Fix completion of help when completing flagsEyal Posener
2019-11-19Move install package back to project rootEyal Posener
2019-11-18update module import pathEyal Posener
2019-11-18V2Eyal Posener
2019-07-05deprecate match packageEyal Posener
2019-03-07use goreadmeEyal Posener
2018-10-25protect line slicing from index out of rangeEyal Posener
2018-10-19Add support for CMP_POINTEyal Posener
Fixes #72
2017-11-04Merge branch 'master' into split-last-equalEyal Posener
2017-11-04Add logic to complete when last flag uses the equal signEyal Posener
If the last flag is of the form -flag=value, complete the value according to -flag.
2017-11-04Filter matches as a final stageEyal Posener
This simplifies the prediction logic writing, the predictor doesn't need to filter our according to line matching, instead it returns everything and the filtering is done at the end. This does not break current behavior.
2017-05-23Fix installationEyal Posener
Fixes #36
2017-05-11Add Predictor interfaceEyal Posener
2017-05-11Add args structEyal Posener
2017-05-11Improve files and directories completionEyal Posener
2017-05-10Enable completion and executable be the same commandEyal Posener
Fixes #6
2017-05-06Remove Complete structEyal Posener
2017-05-06Roughly add all go commandsEyal Posener
2017-05-05RenamingsEyal Posener
2017-05-05Add file completion flagEyal Posener
2017-05-05Initial commitEyal Posener