Debian Codegraph @

/

debian golang-github-anmitsu-go-shlex 0.0~git20200514.38f4b40-2debian golang-github-anmitsu-go-shlex-dev gomod github.com/anmitsu/go-shlex debiangoinimakefilemarkdownshellyaml 15 files · 128 symbols
README (full)

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

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)
    }
}

output

cp
-Rdp
file name
file name2
dir name

Documentation

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

dir debian/
file .gitignore
file LICENSE
file README.md
file example_test.go
file go.mod
file shlex.go
file shlex_test.go