Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dep/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,22 @@
}
}

// WithArgsSet sets arguments for the command.
func WithArgsSet(args ...string) Opt {
return func(c *Cmd) error {
c.cmd.Args = args
return nil
}

Check warning on line 160 in dep/cmd/cmd.go

View check run for this annotation

Codecov / codecov/patch

dep/cmd/cmd.go#L156-L160

Added lines #L156 - L160 were not covered by tests
}

// WithArgsAppend adds arguments to commands current argument list.
func WithArgsAppend(args ...string) Opt {
return func(c *Cmd) error {
c.cmd.Args = append(c.cmd.Args, args...)
return nil
}

Check warning on line 168 in dep/cmd/cmd.go

View check run for this annotation

Codecov / codecov/patch

dep/cmd/cmd.go#L164-L168

Added lines #L164 - L168 were not covered by tests
}

// WithDir sets the working directory for the command.
func WithDir(dir string) Opt {
return func(c *Cmd) error {
Expand Down