Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Strappazzon C committed Aug 15, 2023
1 parent b56b786 commit 47e17a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
8 changes: 4 additions & 4 deletions cli/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Arg struct {
Type uint8
Default any
Function func()
Value string
Value string
}

type Args []Arg
Expand All @@ -29,9 +29,9 @@ func (s *Args) unique(o Arg) bool {

func (s *Args) NamesLength() (l int) {
for _, i := range *s {
if len(i.Name) > l {
l = len(i.Name)
}
if len(i.Name) > l {
l = len(i.Name)
}
}
return l
}
6 changes: 3 additions & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cli

import (
"io"
"flag"
"fmt"
"io"
"strings"
)

Expand Down Expand Up @@ -60,9 +60,9 @@ func (c *CLI) Help() string {
required = " (Required)"
}

name := arg.Name
name := arg.Name
length := c.Args.NamesLength() - len(name)
name += strings.Repeat(" ", length)
name += strings.Repeat(" ", length)

help += fmt.Sprintf(" --%s\t%s%s\n", name, arg.Description, required)
}
Expand Down
19 changes: 0 additions & 19 deletions cli/cli_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion cli/os_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cli
package cli_test

import (
"os"
"testing"

"github.com/debeando/go-common/cli"

"github.com/stretchr/testify/assert"
)

Expand Down

0 comments on commit 47e17a4

Please sign in to comment.