Comma separated -w flags (#294)

* Comma separated -w flags.

* Remove printf

* Updated changelog and contributors

* Alphabetical order
This commit is contained in:
Stephen Haywood 2020-09-14 16:13:21 -04:00 committed by GitHub
parent 47c8cafadc
commit a71f1c0105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,7 @@
- Changed - Changed
- Pre-flight errors are now displayed also after the usage text to prevent the need to scroll through backlog. - Pre-flight errors are now displayed also after the usage text to prevent the need to scroll through backlog.
- The `-w` flag now accepts comma delimited values in the form of `file1:W1,file2:W2`.
- v1.1.0 - v1.1.0
- New - New

View File

@ -1,4 +1,5 @@
# Contributors # Contributors
* [AverageSecurityGuy](https://github.com/averagesecurityguy)
* [bjhulst](https://github.com/bjhulst) * [bjhulst](https://github.com/bjhulst)
* [bsysop](https://twitter.com/bsysop) * [bsysop](https://twitter.com/bsysop)
* [ccsplit](https://github.com/ccsplit) * [ccsplit](https://github.com/ccsplit)

View File

@ -58,7 +58,14 @@ func (m *multiStringFlag) String() string {
} }
func (m *multiStringFlag) Set(value string) error { func (m *multiStringFlag) Set(value string) error {
*m = append(*m, value) delimited := strings.Split(value, ",")
if len(delimited) > 1 {
*m = append(*m, delimited...)
} else {
*m = append(*m, value)
}
return nil return nil
} }