fix command to accept variadic args

This commit is contained in:
Asim Aslam
2019-11-29 11:55:25 +00:00
parent 8b6475b8d4
commit 76b4e78a6a
2 changed files with 4 additions and 10 deletions

View File

@@ -55,12 +55,10 @@ type ReadOptions struct {
}
// WithCommand specifies the command to execute
func WithCommand(c string, args ...string) CreateOption {
func WithCommand(args ...string) CreateOption {
return func(o *CreateOptions) {
// set command
o.Command = []string{c}
// set args
o.Command = append(o.Command, args...)
o.Command = args
}
}