Skip to content

Commit

Permalink
Merge pull request #886 from rsteube/update-shlex
Browse files Browse the repository at this point in the history
updated carapace-shlex
  • Loading branch information
rsteube committed Aug 7, 2023
2 parents 62ef042 + 42b0df5 commit bd350ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (a Action) split(pipelines bool) Action {
invoked := a.Invoke(c)
for index, value := range invoked.rawValues {
if !invoked.meta.Nospace.Matches(value.Value) || strings.Contains(value.Value, " ") { // TODO special characters
switch tokens.CurrentToken().State {
switch current.State {
case shlex.QUOTING_ESCAPING_STATE:
invoked.rawValues[index].Value = fmt.Sprintf(`"%v"`, strings.Replace(value.Value, `"`, `\"`, -1))
case shlex.QUOTING_STATE:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/rsteube/carapace
go 1.15

require (
github.com/rsteube/carapace-shlex v0.0.1
github.com/rsteube/carapace-shlex v0.0.2
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/rsteube/carapace-shlex v0.0.1 h1:8uvsc+ISKw7uoITSp92nNisFUOulYMz+Uu7N5nbHTiM=
github.com/rsteube/carapace-shlex v0.0.1/go.mod h1:zPw1dOFwvLPKStUy9g2BYKanI6bsQMATzDMYQQybo3o=
github.com/rsteube/carapace-shlex v0.0.2 h1:ziSfpJviJkhaSmYvm6weFArTKsMDhd+Dji9HgpTwRCA=
github.com/rsteube/carapace-shlex v0.0.2/go.mod h1:zPw1dOFwvLPKStUy9g2BYKanI6bsQMATzDMYQQybo3o=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
Expand Down
2 changes: 1 addition & 1 deletion internal/shell/nushell/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Patch(args []string) []string {
switch arg[0] {
case '"', "'"[0]:
if tokens, err := shlex.Split(arg); err == nil {
args[index] = (*tokens)[0].Value
args[index] = tokens[0].Value
}
case '`':
args[index] = strings.Trim(arg, "`")
Expand Down

0 comments on commit bd350ea

Please sign in to comment.