Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > bfa6f999ae4eb7bca31e5cd74188d177 > files > 2

golang-github-anmitsu-shlex-devel-0-0.1.mga7.noarch.rpm

# go-shlex

go-shlex is a library to make a lexical analyzer like Unix shell for
Go.

## Install

    go get -u "github.com/anmitsu/go-shlex"

## Usage

```go
package main

import (
    "fmt"
    "log"

    "github.com/anmitsu/go-shlex"
)

func main() {
    cmd := `cp -Rdp "file name" 'file name2' dir\ name`
    words, err := shlex.Split(cmd, true)
    if err != nil {
        log.Fatal(err)
    }

    for _, w := range words {
        fmt.Println(w)
    }
}
```

## Documentation

http://godoc.org/github.com/anmitsu/go-shlex