Skip to content

Commit

Permalink
Fix: Make colon optional for reset (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
shueybubbles authored Dec 12, 2024
1 parent 58bc354 commit abdb3bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sqlcmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func newCommands() Commands {
name: "LISTVAR",
},
"RESET": {
regex: regexp.MustCompile(`(?im)^[ \t]*:RESET(?:[ \t]+(.*$)|$)`),
regex: regexp.MustCompile(`(?im)^[ \t]*?:?RESET(?:[ \t]+(.*$)|$)`),
action: resetCommand,
name: "RESET",
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/sqlcmd/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func TestCommandParsing(t *testing.T) {
{` !! dir c:\`, "EXEC", []string{` dir c:\`}},
{`!!dir c:\`, "EXEC", []string{`dir c:\`}},
{`:XML ON `, "XML", []string{`ON `}},
{`:RESET`, "RESET", []string{""}},
{`RESET`, "RESET", []string{""}},
}

for _, test := range commands {
Expand Down

0 comments on commit abdb3bf

Please sign in to comment.