mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-25 01:04:55 +03:00
'__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:
parent
6219890fb2
commit
97da9a53a3
@ -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
|
||||
|
||||
|
@ -337,6 +337,9 @@ xlsx Microsoft Excel XLSX false https://en.wikip
|
||||
- `--markdown`: Markdown
|
||||
- `--raw`: Raw (bytes)
|
||||
|
||||
## Changelog
|
||||
|
||||
See [CHANGELOG.md](./CHANGELOG.md).
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
|
@ -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]}
|
||||
|
Loading…
Reference in New Issue
Block a user