2016-11-05 17:09:05 -07:00
|
|
|
/*
|
|
|
|
|
Copyright 2016 The Rook Authors. All rights reserved.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2016-09-29 17:09:21 -07:00
|
|
|
package main
|
2016-08-10 09:57:29 -07:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2016-11-07 16:52:46 -08:00
|
|
|
"github.com/rook/rook/pkg/version"
|
|
|
|
|
"github.com/spf13/cobra"
|
2016-08-10 09:57:29 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var versionCmd = &cobra.Command{
|
|
|
|
|
Use: "version",
|
2017-06-25 10:19:59 -07:00
|
|
|
Short: "Print the version number of rook",
|
2016-08-10 09:57:29 -07:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2017-06-25 10:19:59 -07:00
|
|
|
fmt.Printf(" rook: %s\n", version.Version)
|
2016-08-10 09:57:29 -07:00
|
|
|
return nil
|
|
|
|
|
},
|
|
|
|
|
}
|