abiosoft / abiosoft/ishell

Extraneous space for multiline args

Đang mở
#132 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
1.8k
Fork
213
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

First and foremost, thanks for this project! I've been using it successfully in my [AWS Parameter Store shell project](https://github.com/bwhaley/ssmsh).

I've noticed that an extraneous space is added in values with new lines. Here's a reproducible example:

```
package main

import (
"github.com/abiosoft/ishell"
)

func main() {
shell := ishell.New()
shell.AddCmd(&ishell.Cmd{
Name: "test",
Func: func(c *ishell.Context) {
shell.Printf("Got: '%x'\n", c.Args[0])
},
})
shell.Run()
}
```

```
>>> test "foo\
... bar"
Got: '666f6f200a626172'
```

In the hex output we see:
```
666f6f - foo
200a -
626172 - bar
```

The space here is unexpected. I did start looking through the code here but ran out of time before I figured out where it was happening.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.