Skip to content

Commit

Permalink
fix: do not print extra space when there's no label
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 2, 2024
1 parent 05d70f0 commit ad47d0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/commands/pin/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ Example:
if stream {
if quiet {
fmt.Fprintf(w, "%s\n", out.PinLsObject.Cid)
} else if out.PinLsObject.Label == "" {
fmt.Fprintf(w, "%s %s\n", out.PinLsObject.Cid, out.PinLsObject.Type)
} else {
fmt.Fprintf(w, "%s %s %s\n", out.PinLsObject.Cid, out.PinLsObject.Type, out.PinLsObject.Label)
}
Expand All @@ -414,6 +416,8 @@ Example:
for k, v := range out.PinLsList.Keys {
if quiet {
fmt.Fprintf(w, "%s\n", k)
} else if v.Label == "" {
fmt.Fprintf(w, "%s %s\n", k, v.Type)
} else {
fmt.Fprintf(w, "%s %s %s\n", k, v.Type, v.Label)
}
Expand Down

0 comments on commit ad47d0c

Please sign in to comment.