summaryrefslogtreecommitdiff
path: root/complete_test.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
2020-04-09Add github actionsEyal Posener
2019-11-21Fix completion of help when completing flagsEyal Posener
2019-11-18update module import pathEyal Posener
2019-11-18V2Eyal Posener
2019-10-23reproduce sub command bugEyal 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-08-24Fix tests from rebaseAlex Dadgar
2017-08-24Default to hiding flags that start with hyphen unless last arg has a hyphenAlex Dadgar
2017-08-24Allow restricting completion of flagsAlex Dadgar
This PR allows a command to specify that flags should only be completed when a prefix is present. The motivation behind this is to have the initial complation to prefer displaying argument completions and only display flag completions when the user enters "hyphen <tab>".
2017-08-23Fix a subcommand matchingAlex Dadgar
This PR fixes an issue where a subcommand matches the current set of commands being examined. Fixes issue https://github.com/posener/complete/issues/46
2017-05-18Fix './' prefix for file completionEyal Posener
2017-05-15Add global flags for commandEyal Posener
Fixes #24
2017-05-13fix nested filesEyal Posener
2017-05-11predict: when searching for files, show also directoriesEyal Posener
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-06nicer signature for PredictSetEyal Posener
2017-05-05Add additional argsEyal Posener
add predition of directories add ability for prediction union
2017-05-05RenamingsEyal Posener
2017-05-05Add file completion flagEyal Posener
2017-05-05Initial commitEyal Posener