Skip to content

Commit

Permalink
chore(cmd): Use go-utils func for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Nov 11, 2024
1 parent 97430d4 commit 9360a05
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 63 deletions.
4 changes: 2 additions & 2 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"path/filepath"
"strings"

"gabe565.com/utils/cobrax"
"gabe565.com/utils/coloryaml"
"github.com/clevyr/yampl/internal/config"
"github.com/clevyr/yampl/internal/util"
Expand All @@ -26,7 +27,7 @@ YAML data can be piped to stdin or files/dirs can be passed as arguments.
Full reference at ` + termenv.Hyperlink("https://github.com/clevyr/yampl#readme", "github.com/clevyr/yampl")

func New(opts ...Option) *cobra.Command {
func New(opts ...cobrax.Option) *cobra.Command {
cmd := &cobra.Command{
Use: "yampl [files | dirs] [-v key=value...]",
Short: "Inline YAML templating via line-comments",
Expand All @@ -44,7 +45,6 @@ func New(opts ...Option) *cobra.Command {
for _, opt := range opts {
opt(cmd)
}

return cmd
}

Expand Down
12 changes: 0 additions & 12 deletions cmd/options.go

This file was deleted.

32 changes: 0 additions & 32 deletions cmd/version.go

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/version_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/clevyr/yampl
go 1.23.2

require (
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e
gabe565.com/utils v0.0.0-20241111043617-0e96df721377
github.com/Masterminds/sprig/v3 v3.3.0
github.com/dmarkham/enumer v1.5.10
github.com/lmittmann/tint v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e h1:UP9HzqvfJI8n6k2XIBe95pixGA36wFx3JiVbPa8RFJE=
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e/go.mod h1:i93PnuU9qG5dNr79l+206DXeYn+E6r7FrqNGSLhjrvw=
gabe565.com/utils v0.0.0-20241111043617-0e96df721377 h1:aEmuX7hwLvjgpfsMQP6Tno/8ZLAX+z7yUJIEhToUuBc=
gabe565.com/utils v0.0.0-20241111043617-0e96df721377/go.mod h1:tDXvyzIUBsT0+OoU3zFYHdpOdYXWAlNHwQKIA/0XOCk=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
Expand Down
3 changes: 2 additions & 1 deletion internal/generate/docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"strings"

"gabe565.com/utils/cobrax"
"github.com/clevyr/yampl/cmd"
"github.com/spf13/cobra/doc"
)
Expand All @@ -21,7 +22,7 @@ func main() {
log.Fatalf("failed to mkdir: %v", err)
}

rootCmd := cmd.New(cmd.WithVersion("beta"))
rootCmd := cmd.New(cobrax.WithVersion("beta"))
if i := strings.Index(rootCmd.Long, "\n\nFull reference at"); i != -1 {
rootCmd.Long = rootCmd.Long[:i]
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log/slog"
"os"

"gabe565.com/utils/cobrax"
"github.com/clevyr/yampl/cmd"
"github.com/clevyr/yampl/internal/config"
)
Expand All @@ -12,7 +13,7 @@ var version = "beta"

func main() {
config.InitLog(os.Stderr, slog.LevelInfo, config.FormatAuto)
root := cmd.New(cmd.WithVersion(version))
root := cmd.New(cobrax.WithVersion(version))
if err := root.Execute(); err != nil {
os.Exit(1)
}
Expand Down

0 comments on commit 9360a05

Please sign in to comment.