Skip to content

Commit

Permalink
fix(cmd/list): show username with no datasets to list
Browse files Browse the repository at this point in the history
  • Loading branch information
advdv committed Mar 5, 2020
1 parent 5b5a79f commit a7cbde6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,15 @@ func (o *ListOptions) Run() (err error) {
}

if len(infos) == 0 {
pn := fmt.Sprintf("%s has", o.Peername)
if o.Peername == "" {
pn = "you have"
}

if o.Term == "" {
printInfo(o.Out, "%s has no datasets", o.Peername)
printInfo(o.Out, "%s no datasets", pn)
} else {
printInfo(o.Out, "%s has no datasets that match \"%s\"", o.Peername, o.Term)
printInfo(o.Out, "%s no datasets that match \"%s\"", pn, o.Term)
}
return
}
Expand Down

0 comments on commit a7cbde6

Please sign in to comment.