go-shellwords

Parse line as shell words

  • 所有者: mattn/go-shellwords
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

go-shellwords

codecov
Build Status
GoDoc

Parse line as shell words.

Usage

args, err := shellwords.Parse("./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)

主要指標

概覽
名稱與所有者mattn/go-shellwords
主編程語言Go
編程語言Go (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2014-06-19 03:04:00
推送於2024-08-13 09:28:24
最后一次提交2022-12-24 01:59:20
發布數13
最新版本名稱v1.0.12 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數551
關注者數8
派生數80
提交數119
已啟用問題?
問題數23
打開的問題數4
拉請求數28
打開的拉請求數3
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?