go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/apps/cnquery/cmd/version.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package cmd
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"github.com/spf13/cobra"
    10  	"go.mondoo.com/cnquery"
    11  )
    12  
    13  // versionCmd represents the version command
    14  var versionCmd = &cobra.Command{
    15  	Use:   "version",
    16  	Short: "Display the cnquery version.",
    17  	Run: func(cmd *cobra.Command, args []string) {
    18  		fmt.Println(cnquery.Info())
    19  	},
    20  }
    21  
    22  func init() {
    23  	rootCmd.AddCommand(versionCmd)
    24  }