'__complete sql @offline_handle' no longer errors, but instead returns the handle (#124)

* '__complete sql @offline_handle' no longer errors, but instead returns the handle

* docs update
This commit is contained in:
Neil O'Toole 2022-12-23 09:32:07 -07:00 committed by GitHub
parent 6219890fb2
commit 97da9a53a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Shell completion is better behaved when a source is offline #123
## [v0.16.0] - 2022-12-16

View File

@ -337,6 +337,9 @@ xlsx Microsoft Excel XLSX false https://en.wikip
- `--markdown`: Markdown
- `--raw`: Raw (bytes)
## Changelog
See [CHANGELOG.md](./CHANGELOG.md).
## Acknowledgements

View File

@ -135,7 +135,7 @@ func (c *handleTableCompleter) complete(cmd *cobra.Command, args []string, toCom
}
// There's some input. We expect the input to be of the
// the form "@handle" or ".table". That is, the input should
// form "@handle" or ".table". That is, the input should
// start with either '@' or '.'.
switch toComplete[0] {
default:
@ -279,8 +279,11 @@ func (c *handleTableCompleter) completeHandle(ctx context.Context, rc *RunContex
tables, err := getTableNamesForHandle(ctx, rc, matchingHandles[0])
if err != nil {
rc.Log.Error(err)
return nil, cobra.ShellCompDirectiveError
// This means that we aren't able to get metadata for this source.
// This could be because the source is temporarily offline. The
// best we can do is just to return the handle, without the tables.
rc.Log.Warn(err)
return matchingHandles, cobra.ShellCompDirectiveNoFileComp | cobra.ShellCompDirectiveNoSpace
}
suggestions := []string{matchingHandles[0]}