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
Merge pull request #1151 from advanderveer/fix-no-username-empty-list
  • Loading branch information
dustmop authored Mar 5, 2020
2 parents 5b5a79f + a7cbde6 commit 129d681
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 129d681

Please sign in to comment.