mattn / Go Shellwords
Licence: mit
Parse line as shell words
Stars: ✭ 355
Programming Languages
go
31211 projects - #10 most used programming language
Labels
Projects that are alternatives of or similar to Go Shellwords
Craftinginterpreters
Repository for the book "Crafting Interpreters"
Stars: ✭ 4,298 (+1110.7%)
Mutual labels: parser
Morphism
⚡ Type-safe data transformer for JavaScript, TypeScript & Node.js.
Stars: ✭ 336 (-5.35%)
Mutual labels: parser
Typed Query Selector
Better typed `querySelector` and `querySelectorAll`.
Stars: ✭ 316 (-10.99%)
Mutual labels: parser
Bad json parsers
Exposing problems in json parsers of several programming languages.
Stars: ✭ 351 (-1.13%)
Mutual labels: parser
Shortcode
Advanced shortcode (BBCode) parser and engine for PHP
Stars: ✭ 331 (-6.76%)
Mutual labels: parser
Arcsecond
✨Zero Dependency Parser Combinator Library for JS Based on Haskell's Parsec
Stars: ✭ 317 (-10.7%)
Mutual labels: parser
Syntax Parser
Light and fast 🚀parser! With zero dependents. - Sql Parser Demo added!
Stars: ✭ 317 (-10.7%)
Mutual labels: parser
Astroid
A common base representation of python source code for pylint and other projects
Stars: ✭ 310 (-12.68%)
Mutual labels: parser
Hlsltools
A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
Stars: ✭ 336 (-5.35%)
Mutual labels: parser
Md4c
C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
Stars: ✭ 322 (-9.3%)
Mutual labels: parser
Js Quantities
JavaScript library for quantity calculation and unit conversion
Stars: ✭ 335 (-5.63%)
Mutual labels: parser
go-shellwords
Parse line as shell words.
Usage
args, err := shellwords.Parse("./foo --bar=baz")
// args should be ["./foo", "--bar=baz"]
envs, args, err := shellwords.ParseWithEnvs("FOO=foo BAR=baz ./foo --bar=baz")
// envs should be ["FOO=foo", "BAR=baz"]
// args should be ["./foo", "--bar=baz"]
os.Setenv("FOO", "bar")
p := shellwords.NewParser()
p.ParseEnv = true
args, err := p.Parse("./foo $FOO")
// args should be ["./foo", "bar"]
p := shellwords.NewParser()
p.ParseBacktick = true
args, err := p.Parse("./foo `echo $SHELL`")
// args should be ["./foo", "/bin/bash"]
shellwords.ParseBacktick = true
p := shellwords.NewParser()
args, err := p.Parse("./foo `echo $SHELL`")
// args should be ["./foo", "/bin/bash"]
Thanks
This is based on cpan module Parse::CommandLine.
License
under the MIT License: http://mattn.mit-license.org/2017
Author
Yasuhiro Matsumoto (a.k.a mattn)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].