mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2026-10-12 02:12:31 +00:00
31 lines
589 B
Go
31 lines
589 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/core/args"
|
|
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
|
)
|
|
|
|
type cliVersion struct{}
|
|
|
|
func NewCLIVersion() *cliVersion {
|
|
return &cliVersion{}
|
|
}
|
|
|
|
func (cliVersion) NewCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "version",
|
|
Short: "Display version",
|
|
Args: args.NoArgs,
|
|
DisableAutoGenTag: true,
|
|
Run: func(_ *cobra.Command, _ []string) {
|
|
_, _ = os.Stdout.WriteString(cwversion.FullString())
|
|
},
|
|
}
|
|
|
|
return cmd
|
|
}
|