From ad47d0cb20ec382500c166728d9b380882b87dbd Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 15 Dec 2023 10:43:49 +0100 Subject: [PATCH] fix: do not print extra space when there's no label --- core/commands/pin/pin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index 5e5c4175d0e..12ab8e51b32 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -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) } @@ -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) }