GitOps for k8s
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

version_cmd.go 387B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/spf13/cobra"
  5. )
  6. var version string
  7. func newVersionCommand() *cobra.Command {
  8. return &cobra.Command{
  9. Use: "version",
  10. Short: "Output the version of fluxctl",
  11. RunE: func(cmd *cobra.Command, args []string) error {
  12. if version == "" {
  13. version = "unversioned"
  14. }
  15. fmt.Fprintln(cmd.OutOrStdout(), version)
  16. return nil
  17. },
  18. }
  19. }