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

Added a -gapir-nofallback flag. #2674

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions cmd/gapit/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ func getDevice(ctx context.Context, client client.Client, capture *path.Capture,
return selected, nil
}

if flags.NoFallback {
return nil, log.Err(ctx, nil, "Could not find the requested device.")
}

log.W(ctx, "No compatible devices found. Attempting to use the first device anyway...")

paths, err = client.GetDevices(ctx)
Expand Down
3 changes: 2 additions & 1 deletion cmd/gapit/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ type (
}
GapirFlags struct {
DeviceFlags
Args string `help:"_The arguments to be passed to gapir"`
NoFallback bool `help:"Do not fallback to another device if the requested one could not be found"`
Args string `help:"_The arguments to be passed to gapir"`
}
GapiiFlags struct {
DeviceFlags
Expand Down