File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ package elvish
3
3
4
4
import (
5
5
"fmt"
6
+ "runtime"
6
7
7
8
"github.com/carapace-sh/carapace/pkg/uid"
8
9
"github.com/spf13/cobra"
9
10
)
10
11
11
12
// Snippet creates the elvish completion script.
12
13
func Snippet (cmd * cobra.Command ) string {
13
- return fmt .Sprintf (`set edit:completion:arg-completer[%v] = {|@arg|
14
+ result := fmt .Sprintf (`set edit:completion:arg-completer[%v] = {|@arg|
14
15
%v _carapace elvish (all $arg) | from-json | each {|completion|
15
16
put $completion[Messages] | all (one) | each {|m|
16
17
edit:notify (styled "error: " red)$m
@@ -28,4 +29,9 @@ func Snippet(cmd *cobra.Command) string {
28
29
}
29
30
}
30
31
` , cmd .Name (), uid .Executable ())
32
+
33
+ if runtime .GOOS == "windows" {
34
+ result += fmt .Sprintf ("set edit:completion:arg-completer[%v.exe] = $edit:completion:arg-completer[%v]\n " , cmd .Name (), cmd .Name ())
35
+ }
36
+ return result
31
37
}
You can’t perform that action at this time.
0 commit comments