author | Mikael Berthe <mikael@lilotux.net> |
Fri, 28 Apr 2017 22:00:07 +0200 | |
changeset 26 | 530bd59bae97 |
parent 25 | 280b34baee60 |
child 27 | f4af03fd34a5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright © 2017 Mikael Berthe <mikael@lilotux.net> |
2 |
// |
|
3 |
// Licensed under the MIT license. |
|
4 |
// Please see the LICENSE file is this directory. |
|
5 |
||
6 |
package cmd |
|
7 |
||
8 |
import ( |
|
9 |
"fmt" |
|
10 |
||
11 |
"github.com/spf13/cobra" |
|
26
530bd59bae97
Bump version, display madon version with madonctl version
Mikael Berthe <mikael@lilotux.net>
parents:
25
diff
changeset
|
12 |
|
530bd59bae97
Bump version, display madon version with madonctl version
Mikael Berthe <mikael@lilotux.net>
parents:
25
diff
changeset
|
13 |
"github.com/McKael/madon" |
0 | 14 |
) |
15 |
||
16 |
// VERSION of the madonctl application |
|
26
530bd59bae97
Bump version, display madon version with madonctl version
Mikael Berthe <mikael@lilotux.net>
parents:
25
diff
changeset
|
17 |
var VERSION = "0.3.1" |
0 | 18 |
|
19 |
var versionCmd = &cobra.Command{ |
|
20 |
Use: "version", |
|
21 |
Short: "Display " + AppName + " version", |
|
22 |
Run: func(cmd *cobra.Command, args []string) { |
|
26
530bd59bae97
Bump version, display madon version with madonctl version
Mikael Berthe <mikael@lilotux.net>
parents:
25
diff
changeset
|
23 |
fmt.Printf("This is %s version %s (using madon library version %s).\n", |
530bd59bae97
Bump version, display madon version with madonctl version
Mikael Berthe <mikael@lilotux.net>
parents:
25
diff
changeset
|
24 |
AppName, VERSION, madon.MadonVersion) |
0 | 25 |
}, |
26 |
} |
|
27 |
||
28 |
func init() { |
|
29 |
RootCmd.AddCommand(versionCmd) |
|
30 |
} |