Comma separated -w flags (#294)
* Comma separated -w flags. * Remove printf * Updated changelog and contributors * Alphabetical order
This commit is contained in:
parent
47c8cafadc
commit
a71f1c0105
@ -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
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
9
main.go
9
main.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user