File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,11 @@ type config struct {
18
18
Files files `positional-args:"yes" required:"yes"`
19
19
Ignore ignorePatterns `long:"ignore" short:"i" description:"paths to ignore (glob)"`
20
20
output
21
- IgnoreExcess bool `long:"ignore-excess" description:"ignore excess keys and arrey elements"`
22
- IgnoreValues bool `long:"ignore-values" description:"ignore scalar's values (only type is compared)"`
23
- OutputReport bool `long:"report" short:"r" description:"output report format"`
24
- UseSliceMyers bool `long:"slice-myers" description:"use myers algorithm for slices"`
21
+ IgnoreExcess bool `long:"ignore-excess" description:"ignore excess keys and arrey elements"`
22
+ IgnoreValues bool `long:"ignore-values" description:"ignore scalar's values (only type is compared)"`
23
+ OutputReport bool `long:"report" short:"r" description:"output report format"`
24
+ UseSliceMyers bool `long:"slice-myers" description:"use myers algorithm for slices"`
25
+ Version func () `long:"version" short:"v" description:"print release version"`
25
26
}
26
27
27
28
type output struct {
@@ -32,6 +33,10 @@ type output struct {
32
33
33
34
func readConfig () config {
34
35
var c config
36
+ c .Version = func () {
37
+ fmt .Fprintf (os .Stderr , "%s\n " , Version )
38
+ os .Exit (0 )
39
+ }
35
40
36
41
_ , err := flags .Parse (& c )
37
42
if err != nil {
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ const (
17
17
statusDiffMismatch = 6
18
18
)
19
19
20
+ var (
21
+ Version = "dev"
22
+ )
23
+
20
24
func main () {
21
25
var err error
22
26
conf := readConfig ()
You can’t perform that action at this time.
0 commit comments