Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple task cli option #143

Merged
merged 1 commit into from
Jul 27, 2023
Merged

Conversation

bakurin
Copy link
Contributor

@bakurin bakurin commented Jul 25, 2023

Support for multiple --task CLI option requested in #131

@bakurin bakurin requested a review from umputun as a code owner July 25, 2023 17:29
Copy link
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx. just a coule of minor things

cmd/spot/main.go Show resolved Hide resolved
@@ -198,7 +200,10 @@ func runAdHoc(ctx context.Context, targets []string, r *runner.Process) error {

// runGen generates a destination report for the task's targets
func runGen(opts options, r *runner.Process) (err error) {
targets := targetsForTask(opts.Targets, opts.TaskName, r.Playbook)
var targets []string
for _, taskName := range opts.TaskNames {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably this will cause duplicated targets in the final list. I'm not sure how bad the end result is going to be but deduplication of the result slice sounds like the right thing to do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it causes duplicates in the targets list. I've updated the code and added a test to cover the case.

@bakurin bakurin requested a review from umputun July 26, 2023 10:28
cmd/spot/main.go Outdated Show resolved Hide resolved
@umputun
Copy link
Owner

umputun commented Jul 27, 2023

LGTM, can you pls rebase/squash into a single commit, and I'll merge

@bakurin
Copy link
Contributor Author

bakurin commented Jul 27, 2023

All changes are squashed and rebased on the latest master.
P.S. Thanks for your review.

@umputun umputun merged commit 71dbbcf into umputun:master Jul 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants