Skip to content

Commit 5c01a40

Browse files
committed
Remove extra indentation of list help
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 5491b37 commit 5c01a40

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

cmd/limactl/list.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/cheggaaa/pb/v3/termutil"
1212
"github.com/lima-vm/lima/pkg/store"
13+
"github.com/lithammer/dedent"
1314
"github.com/mattn/go-isatty"
1415
"github.com/sirupsen/logrus"
1516
"github.com/spf13/cobra"
@@ -37,18 +38,17 @@ func newListCommand() *cobra.Command {
3738
Use: "list [flags] [INSTANCE]...",
3839
Aliases: []string{"ls"},
3940
Short: "List instances of Lima.",
40-
Long: `List instances of Lima.
41+
Long: "List instances of Lima.\n" + dedent.Dedent(`
4142
The output can be presented in one of several formats, using the --format <format> flag.
4243
4344
--format json - output in json format
4445
--format yaml - output in yaml format
4546
--format table - output in table format
4647
--format '{{ <go template> }}' - if the format begins and ends with '{{ }}', then it is used as a go template.
47-
` + store.FormatHelp +
48-
`
48+
`) + store.FormatHelp + dedent.Dedent(`
4949
The following legacy flags continue to function:
5050
--json - equal to '--format json'
51-
`,
51+
`),
5252
Args: cobra.ArbitraryArgs,
5353
RunE: listAction,
5454
ValidArgsFunction: listBashComplete,

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ require (
2222
github.com/gorilla/mux v1.8.0
2323
github.com/hashicorp/go-multierror v1.1.1
2424
github.com/lima-vm/sshocker v0.3.1
25+
github.com/lithammer/dedent v1.1.0
2526
github.com/mattn/go-isatty v0.0.17
2627
github.com/mattn/go-shellwords v1.0.12
2728
github.com/miekg/dns v1.1.50

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx
380380
github.com/lima-vm/sshocker v0.3.1 h1:MxqWJVsNZ2AKw/mWJ3n2DBNxFABZpaR79olLIjAQK8o=
381381
github.com/lima-vm/sshocker v0.3.1/go.mod h1:Pv7KiykFCequiWTPMytCbAC92ZT2TSFPgmMqGgh3vm0=
382382
github.com/linuxkit/virtsock v0.0.0-20220523201153-1a23e78aa7a2/go.mod h1:SWzULI85WerrFt3u+nIm5F9l7EvxZTKQvd0InF3nmgM=
383+
github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY=
384+
github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
383385
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
384386
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
385387
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0=

pkg/store/instance.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ type FormatData struct {
213213
IdentityFile string
214214
}
215215

216-
var FormatHelp = "\n" + textutil.PrefixString("\t\t",
217-
"These functions are available to go templates:\n\n"+
218-
textutil.IndentString(2,
219-
strings.Join(textutil.FuncHelp, "\n")+"\n"))
216+
var FormatHelp = "\n" +
217+
"These functions are available to go templates:\n\n" +
218+
textutil.IndentString(2,
219+
strings.Join(textutil.FuncHelp, "\n")+"\n")
220220

221221
func AddGlobalFields(inst *Instance) (FormatData, error) {
222222
var data FormatData

0 commit comments

Comments
 (0)