github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/cmd/gosbom/cli/options/version.go (about)

     1  package options
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  	"github.com/spf13/viper"
     6  )
     7  
     8  type VersionOptions struct {
     9  	Output string
    10  }
    11  
    12  var _ Interface = (*VersionOptions)(nil)
    13  
    14  func (o *VersionOptions) AddFlags(cmd *cobra.Command, _ *viper.Viper) error {
    15  	cmd.Flags().StringVarP(&o.Output, "output", "o", "text", "format to show version information (available=[text, json])")
    16  	return nil
    17  }