Skip to content

Commit

Permalink
Make --id-only and --error work together (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Jul 22, 2023
1 parent 0e6a940 commit 1ea43ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,21 @@ func listProviders(cctx *cli.Context, exclude map[peer.ID]struct{}) error {
return nil
}

onlyWithError := cctx.Bool("error")

if cctx.Bool("id-only") {
for _, pinfo := range provs {
if _, ok := exclude[pinfo.AddrInfo.ID]; ok {
continue
}
if onlyWithError && pinfo.LastError == "" {
continue
}
fmt.Println(pinfo.AddrInfo.ID)
}
return nil
}

onlyWithError := cctx.Bool("error")
for _, pinfo := range provs {
if _, ok := exclude[pinfo.AddrInfo.ID]; ok {
continue
Expand Down

0 comments on commit 1ea43ea

Please sign in to comment.