From 04322da4f563b8589cc0f70bcb9dee3fc3b9c8b2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 17 Jun 2020 14:44:51 -0700 Subject: [PATCH] Fix ls output for format change Ensures `ls -l` still works when listing files and multiple directories. Fixes issues introduced in #776. Signed-off-by: Michael Smith --- cmd/ls.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/ls.go b/cmd/ls.go index 988af7e3c..8166df0e8 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -80,9 +80,11 @@ func formatItem(item lsItem, longFormat bool) [][]string { return rows } +// Pads a row to ensure the same number of columns. +// Note that the name is put at the beginning so directories are listed on the left. func pad(str string, longFormat bool) []string { if longFormat { - return []string{str, "", ""} + return []string{str, "", "", ""} } return []string{str} }