Popularity
1.3
Growing
Activity
0.0
Stable
7
1
2

Programming language: Go
Tags: Miscellaneous    
Latest version: v1.0.0

shellwords alternatives and similar packages

Based on the "Miscellaneous" category

Do you think we are missing an alternative of shellwords or a related project?

Add another 'Miscellaneous' Package

README

shellwords

License Build Status Go Report Card codecov GoDoc

A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell.

Installation

go get github.com/Wing924/shellwords

Usage

import "github.com/Wing924/shellwords"
args, err := shellwords.Split("./foo --bar=baz")
// args should be ["./foo", "--bar=baz"]

args, err := shellwords.Split("./foo 'a b c'")
// args should be ["./foo", "a b c"]
line := shellwords.Join([]string{"abc", "d e f"})
// line should be `abc d\ e\ f`
line := shellwords.Escape("./foo 'a b c'")
// line should be `./foo\ \'a\ b\ c\'\"`

Thanks

This is based on go-shellwords and ruby module: rubysl-shellwords


*Note that all licence references and agreements mentioned in the shellwords README section above are relevant to that project's source code only.