zsh sqlcmd completion is broken
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
Research direction
Reproduce the failure with sqlcmd __complete '' and sqlcmd __complete conf, then read the completion argument path in cmd/sqlcmd/sqlcmd.go around lines 289, 319, 362, and 375, along with cmd/modern/main.go:52. Done means zsh completion for sqlcmd produces suggestions for commands and an empty prompt without panicking.
Written by the indexing model from the issue text.
Description
Installed sqlcmd on MacOS with HomeBrew. After rebuilding ~/.zcompdump the command shows up fine:
% cat ~/.zcompdump | rg sqlcmd
'sqlcmd' '_sqlcmd'
However, trying to autocomplete commands like sqlcmd conf<TAB> or plain sqlcmd <TAB> does nothing.
Looks like there's a real problem there:
~ % sqlcmd __complete ''
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/microsoft/go-sqlcmd/cmd/sqlcmd.isFlag(...)
github.com/microsoft/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:375
github.com/microsoft/go-sqlcmd/cmd/sqlcmd.checkDefaultValue({0x13c831621600, 0x2, 0x13c8317add88?}, 0x1)
github.com/microsoft/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:362 +0x2b8
github.com/microsoft/go-sqlcmd/cmd/sqlcmd.convertOsArgs({0x13c8312b6310?, 0x101b82380?, 0x100e1cb4b?})
github.com/microsoft/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:319 +0x1f0
github.com/microsoft/go-sqlcmd/cmd/sqlcmd.Execute({0x1010ea180, 0x6})
github.com/microsoft/go-sqlcmd/cmd/sqlcmd/sqlcmd.go:289 +0x148
main.main()
github.com/microsoft/go-sqlcmd/cmd/modern/main.go:52 +0x1b4
~ % sqlcmd __complete conf
:0
Completion ended with directive: ShellCompDirectiveDefault
Version: sqlcmd ✔: stable 1.10.0 (bottled)
- Dominant language
- Go
- Stars
- 595
- Forks
- 91
- Avg merge
- 9h 35m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/go-sqlcmd
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
All issues in microsoft/go-sqlcmd
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug group: validation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
codecheckers/chekhov#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100