New 🌊 wave for @helm

Commit a431bf29

a431bf2985f7Merged

Dmitriy Zhilyaev <[email protected]> · 5 years ago · 6 files · ~6 modified

Description

Merge pull request #130 from helmwave/release-0.12.1

Release 0.12.1

Details

Commit
a431bf2985f7
Parent
e970a640ff72
Merge parent
8ade96bbe926

cmd/helmwave/main.gomodifiedView file

@@ -1,6 +1,7 @@
11 package main
22
33 import (
4+ "fmt"
45 "os"
56
67 "github.com/helmwave/helmwave/pkg/action"
@@ -20,6 +21,7 @@
2021 new(action.Down).Cmd(),
2122 new(action.Validate).Cmd(),
2223 new(action.Yml).Cmd(),
24+ version(),
2325 completion(),
2426 }
2527
@@ -39,9 +41,27 @@
3941 c.Flags = logSet.Flags()
4042
4143 c.Commands = commands
44+ c.CommandNotFound = command404
4245
4346 err := c.Run(os.Args)
4447 if err != nil {
4548 log.Fatal(err)
4649 }
4750 }
51+
52+func command404(c *cli.Context, s string) {
53+ log.Errorf("👻 Command %q not found", s)
54+ os.Exit(127)
55+}
56+
57+func version() *cli.Command {
58+ return &cli.Command{
59+ Name: "version",
60+ Aliases: []string{"ver"},
61+ Usage: "Show shorts version",
62+ Action: func(c *cli.Context) error {
63+ fmt.Println(helmwave.Version) // nolint:forbidigo
64+ return nil
65+ },
66+ }
67+}