{"id":13693736,"url":"https://github.com/mattn/go-shellwords","last_synced_at":"2025-05-14T08:09:14.866Z","repository":{"id":17981649,"uuid":"20985825","full_name":"mattn/go-shellwords","owner":"mattn","description":"Parse line as shell words","archived":false,"fork":false,"pushed_at":"2024-08-13T09:28:24.000Z","size":72,"stargazers_count":547,"open_issues_count":7,"forks_count":80,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-14T05:26:20.370Z","etag":null,"topics":["go","parser","shellwords"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mattn","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2014-06-19T03:04:00.000Z","updated_at":"2025-05-11T18:54:47.000Z","dependencies_parsed_at":"2024-01-13T22:55:13.797Z","dependency_job_id":"33453a20-1f73-4c03-9e83-6a215c859303","html_url":"https://github.com/mattn/go-shellwords","commit_stats":{"total_commits":89,"total_committers":14,"mean_commits":6.357142857142857,"dds":0.2696629213483146,"last_synced_commit":"f3bbb6f7f6510c6059561a79e3f105578be4fcce"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgo-shellwords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgo-shellwords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgo-shellwords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattn%2Fgo-shellwords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattn","download_url":"https://codeload.github.com/mattn/go-shellwords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101558,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","parser","shellwords"],"created_at":"2024-08-02T17:01:16.567Z","updated_at":"2025-05-14T08:09:09.859Z","avatar_url":"https://github.com/mattn.png","language":"Go","readme":"# go-shellwords\n\n[![codecov](https://codecov.io/gh/mattn/go-shellwords/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-shellwords)\n[![Build Status](https://travis-ci.org/mattn/go-shellwords.svg?branch=master)](https://travis-ci.org/mattn/go-shellwords)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/mattn/go-shellwords)](https://pkg.go.dev/github.com/mattn/go-shellwords)\n[![ci](https://github.com/mattn/go-shellwords/ci/badge.svg)](https://github.com/mattn/go-shellwords/actions)\n\nParse line as shell words.\n\n## Usage\n\n```go\nargs, err := shellwords.Parse(\"./foo --bar=baz\")\n// args should be [\"./foo\", \"--bar=baz\"]\n```\n\n```go\nenvs, args, err := shellwords.ParseWithEnvs(\"FOO=foo BAR=baz ./foo --bar=baz\")\n// envs should be [\"FOO=foo\", \"BAR=baz\"]\n// args should be [\"./foo\", \"--bar=baz\"]\n```\n\n```go\nos.Setenv(\"FOO\", \"bar\")\np := shellwords.NewParser()\np.ParseEnv = true\nargs, err := p.Parse(\"./foo $FOO\")\n// args should be [\"./foo\", \"bar\"]\n```\n\n```go\np := shellwords.NewParser()\np.ParseBacktick = true\nargs, err := p.Parse(\"./foo `echo $SHELL`\")\n// args should be [\"./foo\", \"/bin/bash\"]\n```\n\n```go\nshellwords.ParseBacktick = true\np := shellwords.NewParser()\nargs, err := p.Parse(\"./foo `echo $SHELL`\")\n// args should be [\"./foo\", \"/bin/bash\"]\n```\n\n# Thanks\n\nThis is based on cpan module [Parse::CommandLine](https://metacpan.org/pod/Parse::CommandLine).\n\n# License\n\nunder the MIT License: http://mattn.mit-license.org/2017\n\n# Author\n\nYasuhiro Matsumoto (a.k.a mattn)\n","funding_links":["https://github.com/sponsors/mattn"],"categories":["开源类库","Open source library"],"sub_categories":["文本处理","Word Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattn%2Fgo-shellwords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattn%2Fgo-shellwords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattn%2Fgo-shellwords/lists"}