Coder Social home page Coder Social logo

hellseher / go-shellquote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kballard/go-shellquote

3.0 1.0 0.0 18 KB

Go utilities for performing shell-like word splitting/joining

License: MIT License

Go 76.05% Dockerfile 9.77% Makefile 14.19%

go-shellquote's Introduction

go-shellquote

This is a clone of the no longer maintaind project go-shellquote, name is kept the same, but import path is altered.

The main purpose is to have features like:

  • go.mod
  • release or versioned tags
  • CI with lint and test
  • local lint and test in containers

See:

PACKAGE

package shellquote
    import "github.com/Hellseher/go-shellquote"

    Shellquote provides utilities for joining/splitting strings using sh's
    word-splitting rules.

VARIABLES

var (
    ErrUnterminatedSingleQuote = errors.New("Unterminated single-quoted string")
    ErrUnterminatedDoubleQuote = errors.New("Unterminated double-quoted string")
    ErrUnterminatedEscape      = errors.New("Unterminated backslash-escape")
)

FUNCTIONS

func Join(args ...string) string
    Join quotes each argument and joins them with a space. If passed to
    /bin/sh, the resulting string will be split back into the original
    arguments.

func Split(input string) (words []string, err error)
    Split splits a string according to /bin/sh's word-splitting rules. It
    supports backslash-escapes, single-quotes, and double-quotes. Notably it
    does not support the $'' style of quoting. It also doesn't attempt to
    perform any other sort of expansion, including brace expansion, shell
    expansion, or pathname expansion.

    If the given input has an unterminated quoted string or ends in a
    backslash-escape, one of ErrUnterminatedSingleQuote,
    ErrUnterminatedDoubleQuote, or ErrUnterminatedEscape is returned.

go-shellquote's People

Contributors

lilyball avatar hellseher avatar pjeby avatar charles-dyfis-net avatar tillberg avatar doriath avatar

Stargazers

M@ avatar  avatar Joe Taber avatar

Watchers

 avatar

go-shellquote's Issues

Go releases require git tags in the format `vX.Y.Z`

Hi!

I was just looking for a modularized version of the shellquote library. How serendipitous that I found your repo so soon after you published it!

I noticed you published a release, tag 0.1.0. However, Go modules require tags to be published in the format v0.0.0 (note the v prefix). If you want to publish the module in a way that is consumable by Go tooling, you should consider tagging with a syntactically valid tag.

Thanks for publishing!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.