Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ func TestActionDirectories(t *testing.T) {

assertEqual(t,
ActionStyledValues(
"_test/", style.Of(style.Blue, style.Bold),
"cmd/", style.Of(style.Blue, style.Bold),
).NoSpace('/').Tag("directories").Invoke(Context{}).Prefix("example/").UidF(uid.Map(
"example/_test/", "file://"+wd("")+"/example/_test/",
"example/cmd/", "file://"+wd("")+"/example/cmd/",
)),
ActionDirectories().Invoke(Context{Value: "example/"}),
Expand Down Expand Up @@ -199,13 +197,11 @@ func TestActionFiles(t *testing.T) {
assertEqual(t,
ActionStyledValues(
"README.md", style.Default,
"_test/", style.Of(style.Blue, style.Bold),
"cmd/", style.Of(style.Blue, style.Bold),
"main.go", style.Default,
"main_test.go", style.Default,
).NoSpace('/').Tag("files").Invoke(Context{}).Prefix("example/").UidF(uid.Map(
"example/README.md", "file://"+wd("example")+"/README.md",
"example/_test/", "file://"+wd("example")+"/_test/",
"example/cmd/", "file://"+wd("example")+"/cmd/",
"example/main.go", "file://"+wd("example")+"/main.go",
"example/main_test.go", "file://"+wd("example")+"/main_test.go",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/development/vhs/word/out/word.xonsh.ascii
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@


────────────────────────────────────────────────────────────────────────────────
> example >/dev/null
> example






────────────────────────────────────────────────────────────────────────────────
> example >/dev/null
> example



Expand Down
10 changes: 0 additions & 10 deletions example/_test/invoke_bash

This file was deleted.

12 changes: 0 additions & 12 deletions example/_test/invoke_elvish

This file was deleted.

3 changes: 0 additions & 3 deletions example/_test/invoke_fish

This file was deleted.

18 changes: 0 additions & 18 deletions example/_test/invoke_oil

This file was deleted.

4 changes: 0 additions & 4 deletions example/_test/invoke_powershell

This file was deleted.

18 changes: 0 additions & 18 deletions example/_test/invoke_xonsh

This file was deleted.

1 change: 0 additions & 1 deletion example/_test/invoke_zsh

This file was deleted.

17 changes: 15 additions & 2 deletions example/cmd/special.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
package cmd

import (
"fmt"
"os"

"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var special = `p1 & < > ' " { } $ # | ? ( ) ; [ ] * \ $() ${} ` + "` ``"

var specialCmd = &cobra.Command{
Use: "special",
Short: "",
Run: func(cmd *cobra.Command, args []string) {},
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 && args[0] != special {
fmt.Printf("expected: %#v\n", special)
fmt.Printf("actual : %#v\n", args[0])
os.Exit(1)
} else {
fmt.Println("ok")
}
},
}

func init() {
Expand All @@ -30,6 +43,6 @@ func init() {
})

carapace.Gen(specialCmd).PositionalCompletion(
carapace.ActionValues(`p1 & < > ' " { } $ # | ? ( ) ; [ ] * \ `+"`", "positional1"),
carapace.ActionValues(special),
)
}
Loading