go-shellwords
go-shellwords copied to clipboard
Parse line as shell words
In Windows, backslashes are used at the OS path separator. When I run this code, I get an incorrect result for the value of `cmd`: func main() { sh :=...
Fixes #38 While this is probably not a perfect solution, I think it makes a good start as it makes all tests pass on Windows and fixes the most common...
I have implemented a way for users to exclude specific separators from the parsing algorithm to make this package more versatile and flexible. Logic is based on storing excluded characters...
Hello, I'm trying to parse the following command: ``` command := "RUN /bin/sh -c echo hi --password "pdhjcrkCHJfSchjd3f837"/ # buildkit" args, err := shellwords.Parse(command) ``` and I'm getting `"RUN", "/bin/sh",...
Specifically, I was testing: ``` s := "pg_dump db -U usr -F c > bck.dump" argv, _ := shellwords.Parse(s) for _, v := range argv { println(v) } ``` Which...
It's not uncommon, in certain scenarios, to use parens inside args. An example can be seen in the [Traefik docs here](https://doc.traefik.io/traefik/providers/docker/#constraints) (click `CLI` and look at the example), where it's...
This patch adds `ParseComment` option that tells the parser to trim line comments. * `foo # bar` -> `[foo]` instead of `[foo, #, bar]` [fzf](https://github.com/junegunn/fzf) uses this library to parse...