Skip to content

Commit

Permalink
fix(completion): Support && and ||
Browse files Browse the repository at this point in the history
#48

It could still be problem when any of string contains characters |;&&||, which would lead into wrong split and breaking of completion.

Still cannot figure out valid command, which would contains these characters so it should not be a REAL problem
  • Loading branch information
Ash258 committed Nov 15, 2020
1 parent 230bc66 commit 7cab3c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supporting/completion/Scoop-Completion.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function TabExpansion($Line, $LastWord) {
.SYNOPSIS
Handle tab completion of all scoop|shovel commands
#>
$lastBlock = [Regex]::Split($Line, '[|;]')[-1].TrimStart()
$lastBlock = [Regex]::Split($Line, '([|;]|[&|]{2})')[-1].TrimStart()

switch -Regex ($lastBlock) {
# https://regex101.com/r/COrwSO
Expand Down

0 comments on commit 7cab3c9

Please sign in to comment.